Differences

This shows you the differences between the selected revisions of the page.

2018-03-04 2018-03-04
links update (martin) modern documentation for cscript/wscript (martin)
Line 10: Line 10:
Use language of your preference. If you have no preference or do not know any scripting language, the easiest may be to use scripting engines available in Windows: Use language of your preference. If you have no preference or do not know any scripting language, the easiest may be to use scripting engines available in Windows:
  * Windows command interpreter (''cmd.exe'') to run ''.bat'' or ''.cmd'' files (for simple tasks);   * Windows command interpreter (''cmd.exe'') to run ''.bat'' or ''.cmd'' files (for simple tasks);
-  * Windows script host (''[[https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490887(v=technet.10)|cscript.exe]]'' or ''[[https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490816(v=technet.10)|wscript.exe]]'') to run Java Script or VB Script files.+  * Windows script host (''[[https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cscript|cscript.exe]]'' or ''[[https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/wscript|wscript.exe]]'') to run Java Script or VB Script files.
===== [[batch_file]] Windows command interpreter (batch files) ===== ===== [[batch_file]] Windows command interpreter (batch files) =====
Line 26: Line 26:
It supports all the features listed in Windows command interpreter section above (with greater flexibility). Plus it includes many advanced functions, you may find useful when using together with WinSCP. See sections below. It supports all the features listed in Windows command interpreter section above (with greater flexibility). Plus it includes many advanced functions, you may find useful when using together with WinSCP. See sections below.
-To use the examples below copy the JScript code to file (e.g. ''example.js'') and use ''[[https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490887(v=technet.10)|cscript.exe]]'' to execute it (use ''/nologo'' to suppress banner):+To use the examples below copy the JScript code to file (e.g. ''example.js'') and use ''[[https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cscript|cscript.exe]]'' to execute it (use ''/nologo'' to suppress banner):
<code batch> <code batch>
cscript /nologo example.js cscript /nologo example.js
Line 95: Line 95:
==== Hidden execution ==== ==== Hidden execution ====
-When executing JScript code with ''[[https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490887(v=technet.10)|cscript.exe]]'', console window is shown. If you want to execute the JScript without showing console window, use ''[[https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490816(v=technet.10)|wscript.exe]]'' instead.+When executing JScript code with ''[[https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cscript|cscript.exe]]'', console window is shown. If you want to execute the JScript without showing console window, use ''[[https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/wscript|wscript.exe]]'' instead.
Some notes for using ''wscript'': Some notes for using ''wscript'':

Last modified: by martin