Link to home
Start Free TrialLog in
Avatar of engineroom
engineroom

asked on

Wscript.Run doesn't work...

Hey all, i'm trying to run an executable but it doesn't seem to work. I tried the command in the cmd line and it works fine, but when i go to asp it doesn't seem to execute. I've set permissions in IIS (6) to executables and scripts and i gave IUSR full control of the asp file but still nothing. I also allowed IUSR and User full permission to the executable but still nothing. Any Ideas?
set wshell = server.createobject("wscript.shell") 
wshell.run "c:\iFtpSvc\iFtpAddU.exe -add user1 -h test.com -n ""John Doe"" -p 123 +chgpass +active +hostadm",0,true
set wshell = nothing

Open in new window

Avatar of justanoob
justanoob

not sure, but maybe this

wshell.run "c:\iFtpSvc\iFtpAddU.exe -add user1 -h test.com -n \"John Doe\" -p 123 +chgpass +active +hostadm",0,true

or this

wshell.run "c:\iFtpSvc\iFtpAddU.exe -add user1 -h test.com -n 'John Doe' -p 123 +chgpass +active +hostadm",0,true

or this will do?

wshell.run "c:\iFtpSvc\iFtpAddU.exe -add user1 -h test.com -n "John Doe" -p 123 +chgpass +active +hostadm",0,true
Avatar of engineroom

ASKER

Thanx, but even if i totally omit the -n parameter, it still doesn't work... .but it does in the command line.
I have had this exact same problem and it is very hard to troubleshoot.  The problem for me was that certain command line programs need access to temp directories or sometimes to other directories with dll's etc. and your IUSR and IWAM accounts may not have permission.  This is how I figured out what I needed:
On your server go to Control Panel -> Administrative Tools --> Event Viewer.
Clear out the logs (Save them first if you want) and try running the app through your asp script again.
Quickly look at the logs (sometimes they fill up fast), in particular the Security log and find errors that are caused by IUSR and/or IWAM trying to access parts of the file structure that they don't have permission to access.  It is not easy but will likely point you in the right direction.  It took me a long time to get command line PGP working in conjunction with SFTP in order to gather data from my database, encrypt it, then send via SFTP to one of my clients.
Good luck.
In that case, using Process Monitor might also help, as it will show you any failed file access attempt, among many other  things:

http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
@rhodesb:

Thanx for your response. sorry to get back so slowly. Anyway, that didn't seem to work. I did exactly what you told me to do and there were no events after i ran the script. I did try running the script using a different executable and it did work, but i can't seem to get it to work for this...? don't know.

@justanoob:
Tried the modified command-line script and that also didn't  work.

Thanx guys... any other ideas?
Does anyone have any other suggestions???? I'm experiencing this problem on a different machine and don't know why. It won't work..!
ASKER CERTIFIED SOLUTION
Avatar of rhodesb
rhodesb

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial