Admin rights for batch


  1. Posts : 136
    Windows 7
       #1

    Admin rights for batch


    I got a batch script which needs Admin privileges.
    For example it installs some Programmes or move/copy files to/from System directories.

    So on Windows 7 (and Vista) I can say "Run as" and I got a Message like "are you sure allowing ... bla" OK/Cancel?
    But how I can get arround this MSG-Box?
    How can I place the Admin Name/PW in the Batchfile? (a runas cmd i allready tried seems to don't work)
      My Computer


  2. Posts : 1,241
    Windows 7 Profesional x86, Mac OS X 10.6 Snow Leopard
       #2

    As far as I am aware you are asking the impossible., or at least the stupendously difficult

    You can however turn off UAC prompts completely so you just have to do Run as Administrator and it's done.

    Another neat trick is start a program from within an elevated program (such as a dock); all programs opened using an elevated program themselves are automatically elevated .

    Oli
      My Computer


  3. Posts : 3,300
    Win7 Home Premium 64x
       #3

    Crtl+Shift+Mouse Click will launch the app with admin priveledges.

    Otherwise, you can make a shortcut to the .bat file that has admin priveledges through this tut:

    Elevated Program Shortcut without UAC Prompt - Create
      My Computer


  4. Posts : 31
    MAC OS X v10.4.10
       #4

    I have an idea. I am not sure if this would work with batch file or if you would even want to do this? You might be able to set it up so the user would take ownership of the batch. Once the user 'takes ownership' then they won't get the prompt to enter admin/pw. Let me know if you need details on how to do this and I will provide them for you.
      My Computer


  5. Posts : 1,241
    Windows 7 Profesional x86, Mac OS X 10.6 Snow Leopard
       #5

    StuberB said:
    I have an idea. I am not sure if this would work with batch file or if you would even want to do this? You might be able to set it up so the user would take ownership of the batch. Once the user 'takes ownership' then they won't get the prompt to enter admin/pw. Let me know if you need details on how to do this and I will provide them for you.
    Please correct me if I am wrong but I believe you are confusing two different things.

    Permissions &

    Elevated verification (UAC, it's a security feature).

    He already owns the file, Windows is just insisting that to run it as an Administrator you have to go through a UAC prompt.

    Since Vista all normal command prompt Windows have been with normal user privileges only unless you specify to open it as an Admin (yet another security feature).

    I hope this clears things up, and if I've got anything wrong please correct me .

    Oli
      My Computer


  6. Posts : 31
    MAC OS X v10.4.10
       #6

    I re-read the orginial problem and went through Thorsen solution and I agree this is what is needed to prevent UAC prompt for admin rights . . . I was suggesting a solution for a different problem. . . you are correct osholt
      My Computer


  7. Posts : 1,241
    Windows 7 Profesional x86, Mac OS X 10.6 Snow Leopard
       #7

    StuberB said:
    I re-read the orginial problem and went through Thorsen solution and I agree this is what is needed to prevent UAC prompt for admin rights . . . I was suggesting a solution for a different problem. . . you are correct osholt
    Don't worry, we all make mistakes. As long as you learn from them it's fine .

    Have a nice day/night.

    Oli
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:49.
Find Us