Base64 Encode String in VBScript

I was originally using some VBScript code from Antonin Foller: Base64 Encode VBS Function and Base64 Decode VBS Function. Searching Antonin’s site, I saw he had some code for quoted printable encoding, using the CDO.Message object, so I tried that. Finally, I ported the code mentioned in Mark’s answer to VBScript (also used some code … Read more

Can I pass an argument to a VBScript (vbs file launched with cscript)?

You can use WScript.Arguments to access the arguments passed to your script. Calling the script: cscript.exe test.vbs “C:\temp\” Inside your script: Set File = FSO.OpenTextFile(WScript.Arguments(0) &”\test.txt”, 2, True) Don’t forget to check if there actually has been an argument passed to your script. You can do so by checking the Count property: if WScript.Arguments.Count = … Read more

Difference between wscript and cscript

In Windows, an executable is either a console application or a Windows application (or a SFU or Native application, but that doesn’t matter here). The kernel checks a flag in the executable to determine which. When starting using CreateProcess WinAPI function, if it is a console application, the kernel will create a console window for … Read more

Windows XP or later Windows: How can I run a batch file in the background with no window displayed?

Here is a possible solution: From your first script, call your second script with the following line: wscript.exe invis.vbs run.bat %* Actually, you are calling a vbs script with: the [path]\name of your script all the other arguments needed by your script (%*) Then, invis.vbs will call your script with the Windows Script Host Run() … Read more

“rm -rf” equivalent for Windows?

RMDIR or RD if you are using the classic Command Prompt (cmd.exe): rd /s /q “path” RMDIR [/S] [/Q] [drive:]path RD [/S] [/Q] [drive:]path /S Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree. /Q Quiet mode, do not ask if ok to … Read more

tech