在vbs中转换bat命令

时间:2014-07-18 05:16:54

标签: windows batch-file vbscript

我需要在bat中转换1命令到vbs。有人能帮助我吗?

del /f /q /s "%HOMEDRIVE%%HOMEPATH%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook\*.*"

我试图复制一些像其他人一样的命令,但我确实没有工作

2 个答案:

答案 0 :(得分:1)

没有调用cmd的“纯”vbscript:

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set wshShell = CreateObject( "WScript.Shell" )

homedrive=wshShell.ExpandEnvironmentStrings( "%HOMEDRIVE%" )
homepath=wshShell.ExpandEnvironmentStrings( "%HOMEPATH%" )
objFSO.DeleteFile(homedrive & homepath & "\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook*.*"),true

答案 1 :(得分:0)

Shell("cmd.exe /c del /f /q /s ""%HOMEDRIVE%%HOMEPATH%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook*.*""")