William Allen
2005-06-25 11:21:26 UTC
Just a minor point...
Batch files often use Windows Script Host VBS or JS files created
on-the-fly and executed with CSCRIPT.EXE - typical syntax is:
cscript//nologo MyScript.VBS parameters>CaptureSTDOUT.txt
You need to use the //nologo switch to suppress the logo, otherwise
a text logo along the lines of:
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
is also output on SDTOUT by CSCRIPT and captured in your workfile.
Output of the logo is the default action when WSH is installed. For
your own system, you can change the default to //nologo as follows:
(a) Locate the file WSCRIPT.EXE (not the CSCRIPT.EXE command-line version)
(b) Double-click it in Windows Explorer
(c) A dialogue box appears with a check box saying something like:
"Display logo when executed in MS-DOS prompt"
(d) Uncheck the box, and click OK.
After that, CSCRIPT no longer needs the //nologo switch to
suppress its usual STDOUT text logo.
============Screen capture Windows 95
C:\WORK>type UptownTopRankin.vbs
wscript.echo "No pop no logo - I'm strictly roots"
C:\WORK>cscript UptownTopRankin.vbs
No pop no logo - I'm strictly roots
C:\WORK>rem To see the logo, use //logo
C:\WORK>cscript//logo UptownTopRankin.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
No pop no logo - I'm strictly roots
C:\WORK>
============End screen capture
. . .
For those interested, the Wscript dialogue box zeros a registry key.
The registry path is something like (may vary with system):
HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
"DisplayLogo"=dword:00000000
Obviously, in Batch files written for others to use, you still need
to use //nologo with CSCRIPT. Alternatively, in some circumstances,
say for distribution around a work group, you may want to include a
few lines of Batch code to set the relevant registry key instead
(remember to "quote" the HKEY path in any regedit command line
you may use to to read it before changing it - since it has [Space]s).
--
William Allen
Free interactive Batch Course http://www.allenware.com/icsw/icswidx.htm
Batch Reference with examples http://www.allenware.com/icsw/icswref.htm
Header email is rarely checked. Contact us at http://www.allenware.com/
Batch files often use Windows Script Host VBS or JS files created
on-the-fly and executed with CSCRIPT.EXE - typical syntax is:
cscript//nologo MyScript.VBS parameters>CaptureSTDOUT.txt
You need to use the //nologo switch to suppress the logo, otherwise
a text logo along the lines of:
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
is also output on SDTOUT by CSCRIPT and captured in your workfile.
Output of the logo is the default action when WSH is installed. For
your own system, you can change the default to //nologo as follows:
(a) Locate the file WSCRIPT.EXE (not the CSCRIPT.EXE command-line version)
(b) Double-click it in Windows Explorer
(c) A dialogue box appears with a check box saying something like:
"Display logo when executed in MS-DOS prompt"
(d) Uncheck the box, and click OK.
After that, CSCRIPT no longer needs the //nologo switch to
suppress its usual STDOUT text logo.
============Screen capture Windows 95
C:\WORK>type UptownTopRankin.vbs
wscript.echo "No pop no logo - I'm strictly roots"
C:\WORK>cscript UptownTopRankin.vbs
No pop no logo - I'm strictly roots
C:\WORK>rem To see the logo, use //logo
C:\WORK>cscript//logo UptownTopRankin.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
No pop no logo - I'm strictly roots
C:\WORK>
============End screen capture
. . .
For those interested, the Wscript dialogue box zeros a registry key.
The registry path is something like (may vary with system):
HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
"DisplayLogo"=dword:00000000
Obviously, in Batch files written for others to use, you still need
to use //nologo with CSCRIPT. Alternatively, in some circumstances,
say for distribution around a work group, you may want to include a
few lines of Batch code to set the relevant registry key instead
(remember to "quote" the HKEY path in any regedit command line
you may use to to read it before changing it - since it has [Space]s).
--
William Allen
Free interactive Batch Course http://www.allenware.com/icsw/icswidx.htm
Batch Reference with examples http://www.allenware.com/icsw/icswref.htm
Header email is rarely checked. Contact us at http://www.allenware.com/