All Questions
Tagged with wsh command-line
18
questions
1
vote
1
answer
1k
views
How to prefill the command prompt with some chars?
In a batch file, I want to open a command prompt (and keep it open), and prefill the command with the text "git clone", so I just need to copy a project's URL.
This is how I open a command-prompt and ...
2
votes
0
answers
933
views
Calling multiple command-line commands from vbscript / wscript in a single shell instance
I'm trying to improve the performance of my vb script. I need vbs to programmatically transform and import xml files into an MS Access database, and that works fast. After I run an xsl transform on a ...
0
votes
1
answer
100
views
How to execute a Runtime command in a jar file from a USB drive?
My Java app runs a command like this :
String Command="C:\A_Test\Dir_PC_Customizer\Chinese_English_Dictionary_PinItem.cmd";
Runtime.getRuntime().exec(Command);
I packaged it into a Jar file and it ...
0
votes
1
answer
1k
views
Can I execute a remote placed .vbs file using wscript command?
I have tried using the wscript command with local file share and it works perfectly.
Ex: wscript \\192.168.10.1\script\hello.vbs
Is there any way I can run the file from remote HTTP server?
...
0
votes
1
answer
959
views
WScript.Shell vs cmd.exe - WorkingDir differences?
I've got an ActiveX script which starts an application.
var shell = new ActiveXObject("WScript.Shell");
shell.run('appli.exe');
The script works fine. Nevertheless, if I open cmd.exe and type in ...
2
votes
1
answer
4k
views
Clear Screen when executed via cscript?
I've tried a few things, from WScript.Echo "cls" to crazy functions like the ones below I found on the internet.
Set CrlScrn = WScript.CreateObject("WScript.Shell")
CrlScrn.SendKeys "CLS + {ENTER}"
...
0
votes
1
answer
622
views
Equivalent of UNIX `exec` in JScript / Windows Script Host
I've got a .js file that's meant to be executed by Node.js on the command-line. I've got everything set up with npm and such to put the file into the user's path as a "bin". My problem is, because the ...
3
votes
2
answers
33k
views
Get default printer remotely
Windows 7:
cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -g
Windows XP:
cscript C:\windows\system32\prnmngr.vbs -g
These will get the default printer of the current system. ...
1
vote
1
answer
4k
views
Capture output of cmd query from Wscript.Shell run method
I am using following code to to execute a merge action . This command initiates a child process (manual merge tool) . but using this code child process could not be opened.
But i get error and output ...
38
votes
4
answers
66k
views
How do I set the timezone from command line ?
How can I set the timezone in Windows from command line or from a batch file?
Do I need to use powershell or cscript?
9
votes
3
answers
11k
views
There's any way to run vbscript directly to wscript or cscript command line
I want to run a vbs command from command line as I would in batch calling
cmd.exe /c "echo.Hello World! & pause"
Obviously this doesn't work
wscript /C MsgBox("Hello world")
I could print the ...
0
votes
1
answer
4k
views
vbscript pass the current directory as named argument
I'm trying to pass the working directory to vbscript as a named argument. The system normally expands "." to the current path, but when I check the named argument I just get the string "."
Here's ...
1
vote
2
answers
713
views
Pass string with quote into a VB application with cscript.exe
I have a VB script that takes in several parameters that could include spaces using cscript, and I make the call using:
nsExec::exec 'cscript.exe "$PATH_TO_FILE\program.vbs" "Something with spaces" "...
0
votes
2
answers
315
views
prompt in window for vbscript
I have a vbscript that runs on the command line in xp. It accepts one argument for the path to a directory. Is there a simple way to prompt the user in the command line box for this?
If not, I can ...
0
votes
1
answer
5k
views
WScript.Echo throwing object required error in vbscript
I'm trying to display messages as my vbscript program runs. It runs off a command prompt in xp, for example: cscript.exe test.vbs. I don't want to use msgBox while this is running as I just want it ...