• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 723
  • Last Modified:

permission denied Microsoft VBScript runtime error '800a0046

Unable to execute a Wscript shell command to sort a file. Receive the message "permission denied Microsoft VBScript runtime error '800a0046" It worked in Windows 2000 server but not in 2003.
DIM sortLine, sortFile, server_shell, strTempFile
  set server_shell = server.CreateObject("Wscript.Shell")
  sortFile = DefPath & "XXXXrent" & replace(stmntDt,"/","") & ".txt"
   sortLine = "sort " & txtfile & " /O " & sortFile 
   strTempFile = "%comspec% /c " & sortLine
   server_shell.Run strTempFile, 0, True

Open in new window

1 Solution
Dan McFaddenSystems EngineerCommented:
I would check to see if both servers have the system variable %comspec% set up on the 2003 server.  The %comspec% is a environment variable that points to the location of command shell, cmd.exe.  If the server doesn't have that variable in place, I suggest you add it:  ComSpec=C:\Windows\system32\cmd.exe
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now