Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a server access where I want to run some bat files in startup that can run automatically for any user.

The problem is

  1. Other users are unable to run this file and it is required to be run as the user who created the file (Don't know why?, possibly because they don't have admin privileges)

  2. Even with runas they are prompted for a password. I dont have a problem sharing the password but don't know how the task will be automated.

I tried runas /savecred /user:Username "c:/xyz.bat" but it fails. The command runas works with /netonly but then it promots for a password.

Is there anyway this can be solved and the batch job automated for another user?

share|improve this question
add comment

3 Answers

For allowing users to run the file as a different (pre-configured) user, I've had success in the past using Run as SPC, when I had a similar situation. You configure the cryptfile with the intended username and password, and the executable to be run, and it can then be used by anyone without actually giving them access to the account outside of being able to run that specific executable.

share|improve this answer
add comment

Windows has a file called Autoexec.bat that allows you to run several commands after a user logs in. As for the permission, it is possible you placed the application on a place locked to ordinary users (assuming it was a NTFS partition), so a solution would be to place the program in the drive's root (say, C:/). Then again, and AFAIK, programs ask for permission when:

  • They are locked in a folder only reachable by administrator users.
  • They mess with the Registry or other parts of the Operating System (at which point the UAC kicks in).
share|improve this answer
add comment

Create a scheduled task, and run it as a given user.

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.