Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to create a script that could be run from servers network share and promt me to type servers local username and password as credentials.

So, .bat file is located at \SERVER\INSTALL\Windows XP\RUN.bat

I want to be able to run "run.bat" from any system in the network without opening cmd.exe as different user. Just double click run.bat from the servers share and it starts up second batch - if credentials are OK.

This is how far i could get. I launch the RUN.bat batch containing lines

runas /env /user:SERVER\USER "\\SERVER\INSTALL\Windows XP\install.bat

And this should launch the second batch containing the full script, that works fine individually.

When Run.bat asks to type the password for USER - there is an error. Bad username or wrong password. (Local user is created on the server and has enough permissions)

share|improve this question
    
This cannot work if the account doesn't exist locally. Please explain what you're planning to do with the login. Access a network share, perhaps? –  Daniel B Jun 6 at 6:17
    
By the way. It works fine using a domain\user –  Andris1k94 Jun 6 at 6:22
    
Yes i want to access the share, using servers local user, where the file is hosted on. –  Andris1k94 Jun 6 at 6:23
    
stackoverflow.com/questions/14639743/… - This actually helped me to get my answer. –  Andris1k94 Jun 6 at 8:02
    
i did it myself :) added runas /env /netonly /user:DFIU "<File>" –  Andris1k94 Jun 6 at 8:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.