whaccybanany
27th January 2006, 14:34
I am writing out a VBScript, which on execution creates a virtual directory. This is detailed at http://nsis.sourceforge.net/Setting_up_a_virtual_directory
My problem is when a virtual directory can not be created, I would like the user to try again with another name. But I can't seem to test when the script exits with error.
code snippet:
ClearErrors
nsExec::Exec /TIMEOUT=20000 '"$SYSDIR\cscript.exe" "$TEMP\createVDir.vbs"'
IfErrors success
MessageBox MB_OK "Virtual directory $serverVirtualDir could not be created!"
goto finish
end of vbscript:
If (E******mber <> 0) Then
WScript.Quit (E******mber)
So as far as I can see, if script fails to create virtual directory, the vbscript should exit with an error, and IfErrors should be pick this up.
Can anyone tell me what I am not doing please?[
My problem is when a virtual directory can not be created, I would like the user to try again with another name. But I can't seem to test when the script exits with error.
code snippet:
ClearErrors
nsExec::Exec /TIMEOUT=20000 '"$SYSDIR\cscript.exe" "$TEMP\createVDir.vbs"'
IfErrors success
MessageBox MB_OK "Virtual directory $serverVirtualDir could not be created!"
goto finish
end of vbscript:
If (E******mber <> 0) Then
WScript.Quit (E******mber)
So as far as I can see, if script fails to create virtual directory, the vbscript should exit with an error, and IfErrors should be pick this up.
Can anyone tell me what I am not doing please?[