Wscript.Shell.run returns 254

D

Daniel Di Vita

I am trying to run a command line from an ASP page. I am using windows 2003
with IIS6. I am able to get this to run on my local machine (Windows XP
IIS5). Here is my code:

jobNbr = Request.QueryString("jobNbr")

'Log in as an admin. I created a component to impersonate an administrator.
‘This works fine
Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser")
objLogon.Logon "AdminUser", "AdminPassword", "domain"


Set wShell = Server.CreateObject("WSCRIPT.SHELL")
svrPath = Server.MapPath("/")
FilesPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\" & jobNbr
ZipPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\ZippedFiles\" & jobNbr &
".zip"
strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath

returncode = wShell.run(strZip,0,true)
response.write returncode

Set wShell = nothing
objLogon.LogOff
set objLogon = nothing

When I run this th ReturnCode’s value is 254. I can’t find any info about
this code. I am assuming it has something to do with permissions or how IIS
is setup. I have tried creating a new application pool for this, but I still
get the same result. I checked the Web Service extensions and that seems to
look OK, but I could be wrong.

Thanks
 
S

Slim

try writing the command to the page

response.write strZip

then copy and run it manually see if you can spot a error
 
D

Daniel Di Vita

I have and it does work on a command line.

Slim said:
try writing the command to the page

response.write strZip

then copy and run it manually see if you can spot a error
 
D

Daniel Di Vita

I know you are trying to help, but you need to read my post. I stated I was
able to get this to work on my local XP machine. On my 2003 server is where I
am having the problem. Here is a response.write of the string:

wzzip.exe -rp -ee -ybc
E:\openshare\applications\dev\AFLDirect\Zip\QcsFiles\ZippedFiles\12345667.zip
E:\openshare\applications\dev\AFLDirect\Zip\QcsFiles\12345667

I have tried using hte full path of the wzzip.exe, but that still doesn't
work.
 
A

Anthony Jones

Daniel Di Vita said:
I am trying to run a command line from an ASP page. I am using windows 2003
with IIS6. I am able to get this to run on my local machine (Windows XP
IIS5). Here is my code:

jobNbr = Request.QueryString("jobNbr")

'Log in as an admin. I created a component to impersonate an administrator.
'This works fine
Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser")
objLogon.Logon "AdminUser", "AdminPassword", "domain"


Set wShell = Server.CreateObject("WSCRIPT.SHELL")
svrPath = Server.MapPath("/")
FilesPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\" & jobNbr
ZipPath = svrPath & "\devl\AFLDirect\Zip\QcsFiles\ZippedFiles\" & jobNbr &
".zip"
strZip = "wzzip.exe -rp -ee -ybc " & ZipPath & " " & FilesPath

returncode = wShell.run(strZip,0,true)
response.write returncode

Set wShell = nothing
objLogon.LogOff
set objLogon = nothing

When I run this th ReturnCode's value is 254. I can't find any info about
this code. I am assuming it has something to do with permissions or how IIS
is setup. I have tried creating a new application pool for this, but I still
get the same result. I checked the Web Service extensions and that seems to
look OK, but I could be wrong.

Thanks


http://www.codeproject.com/atl/sawzip.asp

I use this component to manipulate/create zip files with in ASP. Although I
do place my own VB wrapper round it to make things even easier and make sure
the interface is script friendly. Having said you should be able to use it
directly from ASP.

Should enable you avoid needing the administrator password being present in
a ASP file and having to launch a separate process to do the zipping.

Anthony.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top