WScript Question

Results 1 to 2 of 2

Thread: WScript Question

  1. #1
    Join Date
    Dec 1969

    Default WScript Question

    Below is the code that im working on. I tried executing the asp file but nothing happened as if it didnt execute the Command. I tried executing the code manually " cmd /c echo y&#124 CACLS E:WEBDownloadsDocuments /e /r EveryOne /g Web-Admin:c " and it worked just fine so now Im confused what the problem is. Help please!!!! Thanks!!<BR><BR>&#060;%<BR>On error Resume Next<BR>strOwner = "WebUser"<BR><BR>Path = "E:WEBDownloads\"<BR>DirectoryPath = Path & "Documents"<BR><BR>&#039;Set Change Permissions for the owner using CACLS.exe<BR><BR>strACLCommand = "cmd /c echo y&#124 CACLS "&_<BR> DirectoryPath &" /e /r EveryOne /g "& strOwner &":c"<BR><BR><BR>Set objWSH = Server.CreateObject("WScript.Shell")<BR>objRTC = objWSH.Run (strACLCommand , 0, True)<BR><BR>Set objWSH = Nothing<BR><BR><BR>response.write strACLCommand<BR><BR>If Err.Number &#060;&#062; 0 then<BR> Response.write "Error!!!!"<BR>End if <BR><BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: WScript Question

    The culprit *might* be the pipe character in there.<BR><BR>I had a bunch of trouble getting commands with pipes and redirection to work, so I put all my code into a .bat file and then just invoked that. That *usually* works.<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