I'm trying to get my button to write a textfile to the user's temp-folder (but I want the file to be appended with a .vbs extension instead of .txt extension).
This is the contents of the file that I'm trying to write:
I've tried using "TextFile.WriteFromString" (making the necessary adjustment to get the .vbs extension) ... but I can't get it to work because it won't accept this content as a string.
Can anyone help me out here? I'm sure the solution is really basic and staring me in the face ... but i just can't get my head around it.
This is the contents of the file that I'm trying to write:
Code:
on error resume next Const TEMPORARY_INTERNET_FILES = &H20& Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace("Temporary Internet Files") Set objFolderItem = objFolder.Self strPath = objFolderItem.Path & "\*.*" Set objFSO = CreateObject("Scripting.FileSystemObject") Wscript.Echo objFolderItem.Path objFSO.DeleteFile(strPath)
Can anyone help me out here? I'm sure the solution is really basic and staring me in the face ... but i just can't get my head around it.
Comment