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("") "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
  • 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.
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.


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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
two submit buttons one form 15 87
How to update a dummy recordset with classic ASP 4 87
format nvarchar field as mm/dd/yyyy 4 71
Passing Parameter to Stored Procedure 4 24
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: and…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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