Can someone give me an example of using ASP to execute DOS command?

Posted on 2003-02-27
Medium Priority
Last Modified: 2008-03-10
I know how to write the codes but it doesn't work for me.  I mean thing was done after running the asp file.

Here is the ASP code:
dim WshShell
set wshshell=server.CreateObject("WScript.shell")
Set WshShell=Nothing
Here is the content of test.bat:

echo this is a test>test.log

After running the above asp code I expect to see a file test.log in my c:\ directory on the server.  But I don't see it.  Can someone give me an example of a working code so I can test to see this shell command object actually works ?

Thanks in advance.  If it works I'll increase the points of course.

Question by:keystrokes
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

Expert Comment

ID: 8039429
Sounds like this is a permissions problem, since the code snippet is syntactically correct.  Do the IUSR and IWAM accounts have execute rights on the test.bat file?

(chomp, chomp)

Expert Comment

ID: 8040059
hi, i'm not really good with executing DOS commands on ASP but i think u can try the ASPExec object, for the full details u can view this thread:


Author Comment

ID: 8348963
This question is being placed in the cleanup area.  Do not post any more comments.

Expert Comment

ID: 8350503
Dear expert(s),

A request has been made to close this Q in CS:

Without a response in 72 hrs, a moderator will finalize this question by:

 - Saving this Q as a PAQ and refunding the points to the questionner

When you agree or disagree, please add a comment here.

Thank you.


Community Support Moderator
Experts Exchange

Accepted Solution

modulo earned 0 total points
ID: 8363512
Saving this Q as a PAQ and refunding the points to the questionner


Community Support Moderator
Experts Exchange

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

764 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