?
Solved

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

Posted on 2003-02-27
5
Medium Priority
?
217 Views
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")
WshShell.Run("c:\test.bat")
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.

0
Comment
Question by:keystrokes
[X]
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
5 Comments
 
LVL 5

Expert Comment

by:gator4life
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?

gator4life
(chomp, chomp)
0
 

Expert Comment

by:Ice69devil
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:
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20435211.html


Cheers
0
 
LVL 3

Author Comment

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

Expert Comment

by:modulo
ID: 8350503
Dear expert(s),

A request has been made to close this Q in CS:
http://www.experts-exchange.com/Community_Support/CleanUp/Q_20588377.html

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.

modulo

Community Support Moderator
Experts Exchange
0
 

Accepted Solution

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

modulo

Community Support Moderator
Experts Exchange
0

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