How to call vbs script from Inno Setup script with cscript and vbs arguments?

The following is the entry that I use to try to create a virtual directory in IIS 6:

[Run] Filename: {tmp}\cscript.exe mkvirtdir.vbs; Parameters: "-c LocalHost -w ""Default Web Site"" -v ""ectUpload_Server""", {app},""ectUpload_Server"""; WorkingDir: {tmp}; Flags: skipifdoesntexist; StatusMsg: Creating IIS Virtual Directory" 

When starting the installation, the following error appears:

  Unable to execute file cscript.exe mkvirtdir.vbs ...
 CreateProcess failed;  code 2.
 The system cannot find the file specified.
+4
source share
1 answer

You get "The system cannot find the specified file." because you provided an absolute path to cscript.exe that is not in the {tmp} directory. 'cscript' should already be in your PATH since it is usually located in C: \ Windows \ System32. From the INNO Setup help file:

The temporary directory used by the installation or uninstall program. This is not the value of the TEMP user environment variable. This is a subdirectory of the user's temporary directory, which is created during installation or uninstallation at startup (with a name like "C: \ WINDOWS \ TEMP \ IS-xxxxx.tmp"). All files and subdirectories in this directory are deleted when installation or deletion is complete. During installation, this is primarily useful for extracting files that should be executed in the [Startup] section, but not needed after installation.

See if removing {tmp} \ from the file name helps.

+2
source

All Articles