Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Wscript.Run doesn't work...

Posted on 2008-10-16
Last Modified: 2008-12-05
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

Question by:engineroom
  • 3
  • 2
  • 2

Expert Comment

ID: 22729866
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

Author Comment

ID: 22730752
Thanx, but even if i totally omit the -n parameter, it still doesn't work... .but it does in the command line.

Expert Comment

ID: 22736262
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.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.


Expert Comment

ID: 22738304
In that case, using Process Monitor might also help, as it will show you any failed file access attempt, among many other  things:


Author Comment

ID: 22766923

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.

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

Thanx guys... any other ideas?

Author Comment

ID: 22868491
Does anyone have any other suggestions???? I'm experiencing this problem on a different machine and don't know why. It won't work..!

Accepted Solution

rhodesb earned 500 total points
ID: 22869113
I still think the problem is likey a permissions problem where IUSR or IWAM don't have access to cmd.exe or wscript.exe or some specific dll or temp folder that are needed by iFTPAddU.exe. You can try using process monitor from SysInternals like justanoob suggested - I'm not very proficient at it so you'll have to ask someone else how to use it effectively - basically just clear the log, then run your asp page that is failing and look for access violations from IUSR and IWAM that happen shortly after, stop the capturing to prevent the list from getting too huge. Like I said above, it can be very tricky to find the permission that is causing the problem, once you do, just give the necessary permissions to fix the problem.

The only other thing that I can think of that would cause this problem (because you said that it works from the command line) is that iFTPAddU.exe is waiting for something, like a prompt.  I'm not familiar with this exact program so I don't know for sure but if you run the program and it fails for any reason and prompts to resolve the issue, you will never see the prompt and the app will just continue to wait.  This will be evident if after trying to run it many times, there are many instances of iFTPAddU.exe showing up in the task manager.  If this is the case, you have to figure out what the prompt is and how to suppress it so the app always finishes.  I also had this problem in setting up PGP because I didn't realize that the first time you encrypted for a new user, it would prompt even if it was set to suppress prompts.

Both these assume that you have some type of physical access to the administrator account on the server (either with a keyboard/monitor/mouse plugged directly into the server or through VNC or Remote Desktop or something similar).  If you don't have access to the server, then you need to talk to someone who does.

Sorry if this isn't really any more help.  Without having physical access to the server to do testing, likely I nor anybody else will be able to give you a definitive answer because we can't view the logs before and after to be able to find the problem for you.  Hopefully this just gets you in the right direction.

The reason it is happening on another server is still likely to be the same problem and until you find the permissions problem or deal with the prompt (whichever is actually causing the problem), it is not likely to ever work on a server that hasn't been set up to deal with this specific problem.  Sorry.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question