Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RunAs 1

Status
Not open for further replies.

clayton74

Technical User
Apr 17, 2002
187
GB
hello
I am new to dos batch files, and I was looking for a bit of help. I have been looking at the runas command. I am able to run a simple command line "runas /user:kids\admin "notepad.exe" by running from the cmd prompt but if I put this in a .bat the batch file continues in a loop not opening notepad
Any help would be appreciated

 
I assume:

. the computername is kids
. the username is Admin

What is the name of the .bat file?
Is the above line exactly as it appears in the .bat file? (You are missing a " mark if so)
Could you copy/paste the .bat file here?

 
Bcastner
Thanks for the reply
The computername is kids and the user is admin. The name of the batch file is called runas.bat Inside the batchfile is the following text

runas /user:kids\admin "notepad.exe"

Many Thanks
 

Either rename the batch file (something other than an XP internal or external command, please!);

or,

Change the execution order. Right click My Computer, Properties, Advanced, Environmental Variables, and edit in the bottom box the order of file extension execution in the variable PATHEXT

I strongly recommend you take the first course of action. Best wishes,
Bill Castner
 
yep - bcastner is correct - runas is a reserved word. rename the file myrunas.bat for example
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top