Discussion Locked

Run As batch file in Windows 2k

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I would like to create a batch file for Windows 2k to run as a specific program? The program current requires me to run as, using my NT Credentials. I know a little about creating batch files but I'm not sure how to create this. Can anyone help.

3 replies

by joseph moore

Well, this can be easy, actually.
Let's say the program is called PROG.EXE and it is stored in C:\PROGRAM FILES\PROG directory.

Open up Notepad and type in :
CALL "C:\PROGRAM FILES\PROG\PROG.EXE"

Save this file as a .BAT file (remember, don't tack on a .TXT at the end of this name; don't make it FILE.BAT.TXT).

Then, open up Scheduled Jobs
Set up a new Scheduled Jobs to run this BAT file, using your username/password when it asks for the account to run the Job as.

That will do it.

hope this helps

by jackofalltech

If I understand your question correctly, you want to be able to start the program WITHOUT entering the specific User ID and Password? If that is the case, use the following:

@RunAS /User:{userid} [d:][\path]program.exe

I strongly urge you NOTto include the password in the batch file but, if you insist, type runas /? at the command line to see how.

Ralph

by huckleberryhound

You might want to consider using the SU.EXE utility from the server resource kit. This is easier to use if you need to specify an alternate username and password.

This discussion is closed to new replies.