user3851609
user3851609

Reputation: 15

Convert bat command in vbs

i need convert 1 command in bat, to vbs. Can anybody help me?

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

I tried to copy some commands like from others but I did did not work

Upvotes: 0

Views: 966

Answers (2)

npocmaka
npocmaka

Reputation: 57252

A "pure" vbscript without calling the cmd:

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

Upvotes: 1

Ross Presser
Ross Presser

Reputation: 6255

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

Upvotes: 0

Related Questions