| bbxrider 2005-06-10, 3:55 am |
| see prev post at end and thanks to mike harris for this solution
if running a program that has files as parameters, shell.run uses
winnt/system32 for the current directory
so its looking there for the files, if there is no path, so you need to
supply a full path and one way to do that
is with mappath
dim pdf, htm, cmd
pdf = server.MapPath("simple.pdf")
htm = server.MapPath("simple.htm")
cmd = """f:\phsData\htmldoc\htmldoc.exe"" --webpage -f " _
& """" & pdf & """" _
& " " _
& """" & htm & """"
runexit=shell.Run(cmd,0,true)
> trying to run a program from my asp program with wscript.shell, see code
> below
> i can run the program successfully from the command line in the dos
window,
> so i know it runs ok in that context
> i created a virtual directory via iis, giving the directory in question
exec
> privileges
> 'f' is not a mapped drive but a logical
> the '0' and 'true' are needed to run program without creating a window
>
> the return code is 1 and the program does not run, however there is no
> additional error information
> in the err.number + err.description.
> can't seem to find anything about shell.run return codes
> any ideas or suggestions from somebody been down this road?
>
> set shell = server.createobject("wscript.shell")
> runexit=shell.Run("""f:\phsData\htmldoc\htmldoc.exe"" --webpage -f
> simple.pdf simple.htm",0,true)
> if (runexit <> 0) then
> response.write "error on htmldoc/ error code = " & runexit & "<BR>"
> response.write "htmldoc Error--> " & Err.number & " - " & Err.Description
&
> "<BR>"
> end if
|