Detect if WSH is installed, and if not install it (from command line) 
Author Message
 Detect if WSH is installed, and if not install it (from command line)

I have a set of VB scripts that require WSH (they are run using
CSCRIPT.EXE). The scripts have to run on Windows NT/2K computers.

What I'd like to do is detect if WSH is installed, and if not then I'd like
to install it via scr55en/scripten.exe from the command line.

I'd like to know what the best way to detect if WSH is installed is -
registry? file search? also, my detection has to be done from an NT
batch/cmd file.

Thanks.

-Alastair



Mon, 19 Jan 2004 01:30:48 GMT  
 Detect if WSH is installed, and if not install it (from command line)
Alastair,

You can look for wscript.exe and/or cscript.exe in %windir%\system32
directory and wsh*.* files to see if they exist using a batch file

like

if Exist %windir%\system32\wscript.exe goto exit

scripten.exe  /Q
goto exit

:exit
exit

Bobby Malik
www.Adminscripts.NET

Quote:
> I have a set of VB scripts that require WSH (they are run using
> CSCRIPT.EXE). The scripts have to run on Windows NT/2K computers.

> What I'd like to do is detect if WSH is installed, and if not then I'd
like
> to install it via scr55en/scripten.exe from the command line.

> I'd like to know what the best way to detect if WSH is installed is -
> registry? file search? also, my detection has to be done from an NT
> batch/cmd file.

> Thanks.

> -Alastair



Mon, 19 Jan 2004 02:41:02 GMT  
 Detect if WSH is installed, and if not install it (from command line)

Quote:
> I have a set of VB scripts that require WSH (they are run using
> CSCRIPT.EXE). The scripts have to run on Windows NT/2K computers.

> What I'd like to do is detect if WSH is installed, and if not then I'd
like
> to install it via scr55en/scripten.exe from the command line.

> I'd like to know what the best way to detect if WSH is installed is -
> registry? file search? also, my detection has to be done from an NT
> batch/cmd file.

Just try to run CSCRIPT and let the errorlevel tell you:

CSCRIPT.EXE>NUL:
IF ERRORLEVEL 1 ECHO CSCRIPT NOT FOUND

or

CSCRIPT && ECHO CSCRIPT FOUND

or try to run a VBS file containing the single line 'WSCRIPT.QUIT 123' and
check for errorlevel 123 or ...

Also, 'FTYPE VBSFILE' will tell you the path to and prefered engine if any
exist (VBSFILE found from 'ASSOC .VBS').

Best regards
Johnny Nielsen



Mon, 19 Jan 2004 03:36:17 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Detect if WSH is installed, and if not install it (from command line)

2. Install a appl depend if the appl is install or not

3. installing services from the command line

4. INF Install Failure when install WSH on WIN2000

5. HOWTO: Detect if WSH is installed.

6. Detect version of IE Before Installing WSH..

7. how to detect wsh installed version?

8. Detect and install WSH if not already installed before running CSCRIPT!!!

9. Running a command from IE4 w/out WSH installed

10. BUG in WSH 5.6 install if Wscript.exe is running while updating WSH

11. Install Desktop Update after IE 5 install

12. after installing WSH on NT4, WSH won`t work

 

 
Powered by phpBB® Forum Software