Questions tagged [wsh]
For questions relating to Windows Script Host (WSH), a language-independent scripting host for the Windows operating system. It allows scripts to be run from both the graphical Windows desktop (via WScript.exe) and the command prompt (via CScript.exe).
203
questions
26
votes
2
answers
66k
views
How can I download a file with batch file without using any external tools?
First to clarify this question is aimed to HTTP(s) download .For FTP may be I'll ask (and answer) another question.
Here are some similar questions - but I want to be more precise .
Besides ...
33
votes
6
answers
119k
views
Base64 Encode String in VBScript
I have a web service load driver that's a Windows Script File (WSF), that includes some VBScript and JavaScript files. My web service requires that the incoming message is base64 encoded. I currently ...
135
votes
10
answers
136k
views
Windows XP or later Windows: How can I run a batch file in the background with no window displayed?
I know I have already answered a similar question (Running Batch File in background when windows boots up), but this time I need to launch a batch:
from another batch,
without any console window ...
91
votes
5
answers
302k
views
Can I pass an argument to a VBScript (vbs file launched with cscript)?
I have this script saved in "test.vbs":
Set FSO = CreateObject("Scripting.FileSystemObject")
Set File = FSO.OpenTextFile(workFolder &"\test.txt", 2, True)
File.Write "testing"
File.Close
Set File = ...
5
votes
2
answers
15k
views
Detect when a web page is loaded without using sleep
I am creating a VB script on windows which opens a site in IE. What I want: Detect when the web page is loaded and display a message. I achieved this by using sleep (WScript.Sleep) for approx. seconds ...
717
votes
24
answers
1.1m
views
"rm -rf" equivalent for Windows?
I need a way to recursively delete a folder and its children.
Is there a prebuilt tool for this, or do I need to write one?
DEL /S doesn't delete directories.
DELTREE was removed from Windows 2000+
92
votes
1
answer
96k
views
Difference between wscript and cscript
What is the difference between cscript and wscript? Which is best for doing Telnet and FTP automation in Windows?
23
votes
5
answers
80k
views
Can I pick up environment variables in vbscript WSH script?
Is is possible to read system environment variables in a Windows Scripting Host (WSH) VBS script?
(I am writing a VBScript using Windows Scripting Host for task for a Cruise Control and want to pick ...
10
votes
6
answers
61k
views
Failproof Wait for IE to load
Is there a foolproof way for the script to wait till the Internet explorer is completely loaded?
Both oIE.Busy and / or oIE.ReadyState are not working the way they should:
Set oIE = CreateObject("...
23
votes
3
answers
9k
views
What is the ProgId or CLSID for IE9's Javascript engine (code-named "Chakra")
Using .NET, I can write an app that hosts a scripting engine that complies with Microsoft's IActiveScript conventions. This includes JScript and VBScript from Microsoft, and also PerlScript, ...
14
votes
5
answers
88k
views
VBScript getting results from Shell
Set wshShell = WScript.CreateObject ("WSCript.shell")
wshshell.run "runas ..."
How do I get the results and display in a MsgBox
7
votes
4
answers
44k
views
How to find the window Title of Active(foreground) window using Window Script Host
I want to find the title of the window which is currently active(having focus) using Window Script Host(WSH) because I want my WSH script to Sendkeys only If the desired window is active.
Note* I am ...
4
votes
4
answers
8k
views
execute WshShell command from a batch script
I've got a simple question:
What's the best way to execute a single WshShell command from a Windows batch (.bat) script?
(hopefully it's not creating a new file with VB code)
10
votes
5
answers
34k
views
Display a message box with a timeout value
The question comes from code like this.
Set scriptshell = CreateObject("wscript.shell")
Const TIMEOUT_IN_SECS = 60
Select Case scriptshell.popup("Yes or No? leaving this window for 1 min is ...
2
votes
3
answers
15k
views
excel: how to convert .bas file to vbscript/exe or running from command line?
How to convert .bas file to vbscript/exe or running from command line ?
I did script in Excel by MS Visual Basic for Aplications, but i can run this scrip only under Excel. How i can make this script ...