Windows7 elevated command prompt priviledges throug a script
this was simple in windows xp.I have a script that installs Citrix web client.Problem I need to copy over the shortcut to users\public\public desktop through this scriptHow can you program the copy to run in the Elevated command prompt mode to do this?
February 11th, 2010 12:55am

Hi Heflin, You should be able to get around this by using the runas command: runas /user:administrator /savecred c:\batchfile.bat you can also use the run as to place the admin's username and password in plain text, but that less desirable. In the above example, the batchfile.bat would contain all of your copy and install commands for the citrix client. Give it a shot, hope it helps, Kevin Costain - @calwell @calwell on Twitter Calwell's Blog Google Profile
Free Windows Admin Tool Kit Click here and download it now
February 11th, 2010 9:17am

Greetings, I agree with Calwell’s reply. It seems that you want to run the copy action as an administrator using the script itself. You can refer the following URLs, hope it would be helpful.Utility Spotlight - Script Elevation PowerToys for Windows Vistahttp://technet.microsoft.com/en-us/magazine/2007.06.utilityspotlight.aspx?pr=blogHow Can I Run a Script Under Alternate Credentials?http://blogs.technet.com/heyscriptingguy/archive/2004/12/13/how-can-i-run-a-script-under-alternate-credentials.aspx Since this issue is more related to scripting, I recommend you open a thread to Official Scripting Guys Forum in Technet so those coders can help you fix the issue in a timely manner.Official Scripting Guys Forum http://social.technet.microsoft.com/Forums/en/ITCG/threadsScript Center: http://technet.microsoft.com/en-us/scriptcenter/default.aspx
February 11th, 2010 12:29pm

Hi, I'm on Win7 Home Premium and I want to write a batch script to start a service ("net start <svcname>"). I have tried runas /user:administrator "net start <svcname>" but it doesn't work: It asks me for the password, I enter it, and then I get the error "unknown user name or bad password." I'm given to understand that, in Windows 7, there is no "administrator" account, so I tried it using my username, but that clearly doesn't run in "elevated" status, which is what I need. One of the answers here shows links to solutions for Vista, but I'm on Windows 7 and it looks like those Vista solutions don't work for Win7. Is there a way to start a service in Win7 Home Premium from a batch file (which requires running "elevated")? It's fine if I have to enter a password, or if the UAC confirmation window pops up. I would strongly prefer not to enable the administrator account (because I don't want to open myself up to other issues). -- mdeck
Free Windows Admin Tool Kit Click here and download it now
September 16th, 2011 11:57pm

p.s. I want to start a service (elevated), then run a program (un-elevated), then stop the service (elevate). If I could figure out a way to start the program un-elevated in a batch, I could run the whole batch file as administrator, but so far I can't get "runas" to start the application as underprivileged me.
September 17th, 2011 12:35am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics