Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Wscript.Run doesn't work...

Posted on 2008-10-16
Medium Priority
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("") "c:\iFtpSvc\iFtpAddU.exe -add user1 -h -n ""John Doe"" -p 123 +chgpass +active +hostadm",0,true
set wshell = nothing

Open in new window

Question by:engineroom
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
  • 3
  • 2
  • 2

Expert Comment

ID: 22729866
not sure, but maybe this "c:\iFtpSvc\iFtpAddU.exe -add user1 -h -n \"John Doe\" -p 123 +chgpass +active +hostadm",0,true

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

or this will do? "c:\iFtpSvc\iFtpAddU.exe -add user1 -h -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.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

721 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