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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch file problem

Status
Not open for further replies.

jdouthit

IS-IT--Management
Jun 15, 2004
14
US
I am currently trying to run Handy Backup v4.0 on a machine using an account that has restricted user rights. I'm wanting to run the program to schedule backups to my cdrw. Handy Backup told me that I can not backup to cdrw unless I am logged in with administrative privelages. B/c of security issues I do not want the user on the machine handy backup is on to have administrative privelages. I've created a batchfile with the following contents:

@ runas /user:localhost\administrator "C:\Program Files\Novosoft\Handy Backup\hbagent.exe"

When ran, the batch file prompts me to enter the localhosts' administrative password. When I type it in it's as if the machine doesn't take the password. Also the restricted user is on a domain. Could that be causing a problem when trying to run the program as localhost\adminstrator?
 
Of course!
Otherwise it would be simple for ANY user to run ANYTHING!

You have to give that user rights to run it, or it will not work.

Marc
[sub]If 'something' 'somewhere' gives 'some' error, expect random guesses or no replies at all. Please specify details.
Free Tip: The F1 Key does NOT destroy your PC!
[/sub]
How Do I Get Great Answers To my Tek-Tips Questions? See faq219-2884
 
Take a look at the runas command in on-line help. You SHOULD be able to runas the administrator, even in a domain.
 
Your localhost/administrator is not the same as the domain/administrator. These are two seperate accounts. Be sure that you are using the right password. Also run the command thats in the batch file from the command line, and be sure to check any error messages. If you use a batch file sometimes the command window closes before you can read any errors or info the system will display. Also I dont see how this would keep the user from gaining admin access to the local machine. With this batch file they would still have to enter the admin password. If they have the admin password they could gain access to anything anyway. There is an easier way to do this in Win XP Pro (Not sure about W2K). Right Click the executable C:\Program Files\Novosoft\Handy Backup\hbagent.exe go to Properties. On the shortcut tab hit advanced, check the run with different creditentials option. Everytime you run this program it will prompt the RunAs box. You can choose the user you want to use from a list and then enter the password. Im not positive, but I think there is a way to tell the OS to always use the account you specified to open that specific excutable and even store the password, so that the runas is transparent to the user. (Although dont quote me on that one) If you do it with a command prompt or batch file I dont believe that you can store the password within the runas command. This only makes sense as if someone were to read the batch file or run the command they could see the admin password.


Let me know if this helps your cause.

Acquisitive_One
MCSA, A+

Acquisitive - 1. Characterized by a strong desire to gain and possess. 2. Tending to acquire and retain ideas or information :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top