Page History
...
- includes references to files (.vbs) including containing VBScript code and/or
- directly includes contains VBScript code.
Therefore the migration of JS1 VBScript jobs to JS7 includes the steps to run running cscript.exe
from a job and to provide providing a Windows Script File (.wsf) that holds references to VBScript files (.vbs).
Command for execution with a Job
The command in a JS7 job to execute which executes VBScript can look like this:
...
- The
cscript.exe
utility is executed with the//NoLogo
switch to suppress unwanted output to stdout. - The path to the Windows Script File
c:\tmp\test.wsf
is used as a parameter.
There could be reasons why to execute for executing VBScript code in a 32bit context, e.g. if the code makes references to the 32bit Windows Registry. In this situation modify the command like thisas follows:
Code Block | ||||
---|---|---|---|---|
| ||||
%WINDIR%\SysWOW64\cmd.exe /k cscript.exe //NoLogo C:\tmp\test.wsf |
Explanation:
- The only difference to the previous example is the use of
%WINDIR%\SysWOW64\cmd.exe /k
that precedes the call to thecscript.exe
utility. - This will create a 32bit bit Windows Shell and will run the
cscript.exe
utility in this context.
...
- Any number of <script> elements can be used.
- Typically the last file included holds the start code.
Compatibility Functions for VBScript Jobs
Should If VBScript jobs in JS1 have used the JobScheduler Job API, e.g. for logging purposes and to read reading parameters then they have to be migrated.
...