silvergs Posted October 16, 2008 Share Posted October 16, 2008 I need to have a command in the Startup group on my Windows Vista 64 bit machine so that it launches a command window running as the administrator and calls a simple batch file to run a program.Can someone please tell me how to do this?TIA! Link to comment Share on other sites More sharing options...
FthrJACK Posted October 16, 2008 Share Posted October 16, 2008 in your batch file, you could use the runas command. or: go to start >> Accessoriesright click on the command prompt shortcut and create a shortcut/send it to desktop. Now right click on the shortcut you just created, and open the properties dialog. go to the "shortcut" tab and click the "advanced" button. A small form will open where you can tick the "Run as Administrator" check box. Use this shortcut to launch your batch.If you are using this as a login / start up script, then why not do it the proper way?go Start >> Computerright click and do "Manage"open the "local Users and groups" branch, in the Users folder, find the user account you want the script to run on, right click and do "Properties"Select the "Profile" tab, and put the path to your logon script in the appropriate box there. If you want the script to run for everyone, then you would apply it to the machine instead of a user, obviously.Hope this helps Link to comment Share on other sites More sharing options...
silvergs Posted October 16, 2008 Author Share Posted October 16, 2008 Thanks for the reply FthrJack!I am a tad confused by your reply, so let me rephrase more clearly what I am attempting to do and then perhaps it will make more sense.I run a program called Folding@Home and the version I am running cannot run as a service (not yet anyway). This simply means that whenever the pc is restarted for whatever reason, I have to launch that program manually.Here is what I have to do to launch it manually:I click Start, right-click on the Command Window program, choose run as administratorWhen the command window opens, I type in cd.. and hit enter and then do that one more time to go the root of the C driveI then cd to FAH I finally type in the name of the executable file - "fah -smp" where -smp is a flag to run the program in high performance mode.Which now explains why I need to run some command in the Startup group that opens a command window (running it as the admin) and then goes to the folding@home directory and calls the executable. Just so that if the pc restarts for whatever reason, I don't have to do run my program manually.Your explanation seems to answer part of my needs but not 100% . Does that make sense? Link to comment Share on other sites More sharing options...
cluberti Posted October 16, 2008 Share Posted October 16, 2008 Well, aside from your inefficiency at using the command prompt (you could simply type C:\fah\fah.exe -smp from anywhere and have it work, or at least cd \fah and then run fah -smp), you do not need the command prompt as admin, you only need fah.exe to run as admin (by running the cmd as admin you're launching anything from there as an admin, but that's an extra step you don't actually need).I second the runas prompt - if you perhaps wanted to do this in vbscript, there are code samples on the forums that will run a vbscript as administrator (and thus launch anything run by the vbscript as admin). That might work for you as well if you want to tackle it. Link to comment Share on other sites More sharing options...
silvergs Posted October 16, 2008 Author Share Posted October 16, 2008 Well, aside from your inefficiency at using the command prompt (you could simply type C:\fah\fah.exe -smp from anywhere and have it work, or at least cd \fah and then run fah -smp), you do not need the command prompt as admin, you only need fah.exe to run as admin (by running the cmd as admin you're launching anything from there as an admin, but that's an extra step you don't actually need).The program has to be run in a command window - it is a console program. It is not a GUI based program. It won't run from anywhere.Please help me make this seemingly very simple task work. Thanks! Link to comment Share on other sites More sharing options...
silvergs Posted October 17, 2008 Author Share Posted October 17, 2008 Anybody? Link to comment Share on other sites More sharing options...
jaclaz Posted October 17, 2008 Share Posted October 17, 2008 You might be interested to this:http://www.msfn.org/board/run-program-Service-t83272.htmljaclaz Link to comment Share on other sites More sharing options...
silvergs Posted October 17, 2008 Author Share Posted October 17, 2008 You might be interested to this:http://www.msfn.org/board/run-program-Service-t83272.htmljaclazThanks for the link jaclaz. This program however is not meant to be run as a service unfortunately. The program can be run as a service when it is run in a normal mode. However in high performance mode, it does not run as a service. Link to comment Share on other sites More sharing options...
jaclaz Posted October 17, 2008 Share Posted October 17, 2008 (edited) Another approach:http://www.steelsonic.com/steelrunas.htmhttp://www.robotronic.de/runasspcEn.htmljaclaz Edited October 17, 2008 by jaclaz Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now