0

I am trying to execute a remote vbscript on a Windows Server 2012 machine. How do I execute a script in a cmd prompt with admin privileges? I tried using "runas" but it prompted for credentials. We need this to run automatically without the need for user interaction.

I saw this answer but it isn't working. When I run it, the cmd prompt just disappears with no error.

How to run vbs as administrator from vbs?

So to summarize, I need to execute a vbscript inside a cmd prompt that has elevated admin privileges. The script has to be automated because there are no users who can interactively provide credentials.

3
  • What do you mean "execute a remote script"? Do you want to execute a script on a remote host? A script from a remote host on the local host? Why do you need it to run in an elevated Command Prompt? What do you mean by "cmd prompt just disappears"? Which of the answers given to the other question did you try, and what exactly did your attempt look like? Sep 12, 2016 at 19:37
  • I have a .CMD file on one server that calls a vbscript file on a remote server. They are in the same network just on different machines. The reason the script has to run with elevated privileges is because Server 2012 kills the cmd session on the remote host. If I right-click the cmd prompt on the Server 2012 machine and "Run as administrator" the script works. In the link I provided, I tried the script marked as the answer and when I run it the cmd prompt doesn't open or execute, it behaves like it was never called, or like it "disappeared" and I can't find anything in the server logs.
    – WorkJ
    Sep 14, 2016 at 13:26
  • "when I run it in the cmd prompt" where? On which host? How exactly do you run it there? What does the content of your script look like? Please provide a comprehensive description of your problem. I'm not sitting in front of your computer, and I'm also not going to play Twenty Questions here. Sep 14, 2016 at 13:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.