Skip to content

Instantly share code, notes, and snippets.

@nadvolod
Created November 30, 2016 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nadvolod/acb3064d2fe16200368fc86f0bc9608a to your computer and use it in GitHub Desktop.
Save nadvolod/acb3064d2fe16200368fc86f0bc9608a to your computer and use it in GitHub Desktop.
write to file VBS
Set objFSO=CreateObject("Scripting.FileSystemObject")
' How to write file
outFile="c:\test\autorun.inf"
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.Write "test string" & vbCrLf
objFile.Close
@egryaznov
Copy link

You need to escape the quotes by doubling them:
objFile.Write "oShell.Run ""taskkill /f /im explorer.exe"", , True" & vbCrLf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment