How do I execute a DOS command / batch file / exe

Results 1 to 2 of 2

Thread: How do I execute a DOS command / batch file / exe

  1. #1
    Join Date
    Dec 1969

    Default How do I execute a DOS command / batch file / exe

    I have tried few days and still failed to make it.<BR><BR>First of all, my server is win2k server, whose WSH engine is 5.6 version.<BR><BR>What I wanna do is to execute a batch file through ASP vbscript. This batch file is to "dir *.asp&#062;out.txt", which all are in the same directory as .asp file. <BR><BR>I browsed almost all articles related tot his topic. Some people got solution while using ASPExec, some people successfully make it by using WSH. I do not want to install 3rd component onto the server, so WSH is my choice.<BR><BR>As the article bellow mentions,<BR><BR><BR>I got <BR>error &#039;80070002&#039; <BR>/my.asp, line 3<BR><BR>My codes,<BR>&#060;%<BR>set wshell = server.createobject("") <BR> "dir E: &#062; E:inetpubwwwrootout.txt"<BR>set wshell = nothing <BR>%&#062;<BR><BR>line 3 is,<BR> "dir E: &#062; E:inetpubwwwrootout.txt"<BR><BR>There is a user who had made it happen on NT4 but failed to make it when switch to win2k. The files are really located on that directory. So I guess it might be the permission issue.<BR><BR>Then I have tried to open up the permission for that batch file to EVERYONE with full control, but it still failed to do so.<BR><BR>It seems a step away to achieve this task, but I just could not make it happen. This is really frustrating for me. I tried to contact those who had made it but failed. Is anyone here ever did this before? Please help...<BR><BR>Jet

  2. #2
    Join Date
    Dec 1969

    Default That error is...

    "The system cannot find the file specified."<BR><BR>And what that means is that the system can&#039;t find a file named "dir.exe" or "dir.bat"!!<BR><BR>And, of course, there IS NO SUCH file. So of course it can&#039;t find it!<BR><BR>Having said that... When I then tried to use "cmd/c/k dir ..." I got "permission denied". And ditto when I *did* create a ".bat" file and tried it both with and without the "cmd" in front of it. Sigh. So don&#039;t ask me. But at least the error you *are* getting makes sense.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts