Weird WScript Problem

Results 1 to 3 of 3

Thread: Weird WScript Problem

  1. #1
    Join Date
    Dec 1969

    Default Weird WScript Problem

    Hi,<BR>I am trying to execute a batch file from ASP. I use Server.MapPath to get the physical path of the file and then attempt to run it. Below is a simplified example of my code<BR><BR>strPath = Server.MapPath ("test.bat")<BR>Set Shell = Server.CreateObject("WScript.Shell")<BR>Shell.Run (strPath)<BR><BR>The error I am getting is &#062;&#062;<BR><BR>error &#039;80070002&#039; <BR>The system cannot find the file specified. <BR>/tv/testFTP.asp, line 9 <BR><BR>Now, I cannot understand this message since in debugging this problem I have used the ASP Scripting.FileSystemObject function FileExists to ensure that this is a valid path and it returns telling me this file does indeed exist. However then when I try and execute the batch file as I showed above it tells me it can&#039;t find it. <BR>I have granted the IUSR account all permission on this directory so I can&#039;t see it being a permission issue and I have no problem executed simple commands with WScript.Shell so I don&#039;t think its a problem with my Windows Scripting Host.<BR><BR>I have beaten my head against a wall and am well and truly stumped. I would appreciate any help.<BR><BR>Thank you.<BR><BR>Noel.<BR>

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default Not sure

    since i have never worked on this but try this<BR><BR>strPath = Server.MapPath ("test.bat")<BR>Set Shell = Server.CreateObject("WScript.Shell")<BR>Shell.Run (strPath & " est.bat")

  3. #3
    Join Date
    Dec 1969

    Default RE: what's in the .bat file?

    aside from that, try WScript.echo()ing the strPath variable

Posting Permissions

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