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!

Need a special batch file 1

Status
Not open for further replies.

cbailey

MIS
Dec 12, 2001
129
US
Is there any way to run a batch file as administrator with a standard user logged in?

I need to run a program that must have admin access in order for it to work. Scheduler is not what I'm lookin for, the user needs to kick of the program.

Thanks
 
Try the below script as a logon:

set WshShell = CreateObject("WScript.Shell")
Set oNetwork = CreateObject("WScript.Network")
PCName = oNetwork.ComputerName
WshShell.Run "runas /user:" & PCName & "\Administrator %SystemRoot%\system32\notepad.exe"
Wscript.Sleep 100
WshShell.Sendkeys "Enter Just The Password"
WshShell.Sendkeys "{enter}"

Just change the colored lines to meet your requirements. Also, you can use the script encoder to make sure no one gets the admin password.
 
Thanks, I will need to look into script encoder.

bcastner - your pointer in you link is broken, can't find the page. thanks anyhow


Thanks again
 
cbailey,
I was able to pull up the thread, and yes, bcastner did provide a VERY GOOD thread. I would try Greg Palmer's program, as it would be easier to implement on your machine.
 
Greg Palmer's RunAs efforts are one of the hidden gemstones of the TT site.

Let me us this opportunity to just give you a big hug and thank you.

 
Please excuse my ignorance, but I haven’t a clue on how to create a script. We do not use policy files. From what I am able to figure out, scripts can only be run at login, logout, startup or shutdown.

I am looking for an icon on the desktop a user can activate at any time. It would be nice to create a batch file and grant it admin rights to function.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top