Re: match machine name to user name

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 02/02/05


Date: Wed, 02 Feb 2005 12:59:35 +0100

PaulD wrote:

> Torgeir,
> Is there any difference between wscript and cscript.

cscript.exe is running the script in a console, so if you e.g. use
WScript.Echo to write out status from your script that is called from
the batch file, the message will be displayed inside the batch file
"window", and it would not have halted the script execution.

If you had used wscript.exe, the message had popped up as an modal
windows message box, halted the script waiting for the user to press
the OK button.

> Also, let's pretend I have not written a bat file in years,
> how do I assign the values to the %1...

In a batch file, %0 is automatically the batch file path, %1 is the
first parameter that was sent in to the batch file on the command
line, %2 is the second parameter that was sent in to the batch file
on the command line etc.

-- 
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Quantcast