How to create a batch file with the runas command and inputting password

Posted on 2004-11-17
Last Modified: 2010-04-14
Hi guys,

We have this scenario.

Windows 2003 AD Domain.
Remote users sometimes have problems with their printers which are fixed by myself remoteing in and starting and stopping the spooler service.
Id like to be able to place a script on the users desktop that they can run when they have the printer issue, so that I can give ownership of this task to them, instead of them ringing me.
I dont want to elevate their user permissions or place the users in a group such as power users.
I want to be able to create a script which runs as admin or as a user that has the power to start and stop the spooler service.
I know that the runas command has no way of automatically entering the password, and was wondering how I can achieve my goal, so that I dont get calls for this support.

Any help greatly appreciated.

Question by:Simon336697
    LVL 20

    Accepted Solution


    You should be able to enable this through group policy. You'd need to make sure your pc's are in an OU, or edit their existing OU. Then in the GPO attached to the OU - navigate to Computer Configuration - Windows Settings - Security Settings - System Services. Double-click the print spooler, enable automatic startup and give domain users group permissions to read, stop and start the service.

    They should then hopefully be able to run the batch under their own credentials,

    Deb :))

    LVL 1

    Assisted Solution


    There is a tool on the market wich I use: TQCrunas
    With this tool you can execute scripts with elevated priviliges whitout showing passwords.


    LVL 1

    Author Comment

    Thanks Deb, Phil....appreciate it.


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Application Deployment - Simple 7 622
    Domain dunctional level. 4 304
    windows 2000 image 3 114
    windows explorer 21 161
    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now