Created
November 30, 2016 17:25
write to file VBS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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
you can't put quotes in the stuff and it messes things up if you're trying to do something specific.
such as writing a file to do
objFile.Write "oShell.Run "taskkill /f /im explorer.exe", , True" & vbCrLf
won't work because of the quotes between the quotes. is there any way to get around that?