I would like to install a batch file but requires an "Administrator" account privillege. Everytime I tried to install this batch file.. a dialog pop-up requiring me to enter my administrator password..... how can can I bypass this dialog.... please help for best solution.

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0

If you run the batch as a kscript you can put in the admin credentials or just let it run as system.

 

Answered 05/20/2014 by: SMal.tmcc
Red Belt

  • I am already using kscript...where can I put my admin credentials?
    • see above
      • I am logged as a Standard User.... the script does not work.. I want to bypass the admin password dialog... can we enter it somewhere. Please help
    • Enter the Admin credentials in the "Run As User" boxes
      • I tried but no way I can install... It shows that I am trying to run the script but nothing is happening after I click the snooze dialog.
    • can you post your batch file?
      • @echo off
        netsh wlan add filter permission=denyall networktype=adhoc
        netsh wlan add filter permission=denyall networktype=infrastructure
        netsh wlan set blockednetworks display=hide
        netsh wlan add filter permission=allow ssid=OTT networktype=infrastructure
      • we can do this a couple of other ways

        You can also add psexec as a dependancy and run that way
        psexec -u user -p password batfile.bat

        or just create 4 "launch a program" line commands in the script and use that.
        Directory: $(KACE_SYS_DIR)
        File: Cmd.exe
        Parameters: /c netsh wlan add filter permission=denyall networktype=adhoc
        and create 3 more for the other 3 commands
      • If you have UAC enabled that is why it is prompting. This is by design from MS to increase the security and keep hackers from using the same process to compromise machines (running bats as admin behind the users credentials)
        http://social.technet.microsoft.com/Forums/scriptcenter/en-US/310e57f9-2367-4293-9f97-53d0e077aacc/vb-script-to-run-a-batch-script-as-admin?forum=ITCG
Please log in to comment
0

Thank you very much for all the help....

Answered 05/20/2014 by: jaimec
White Belt

  • did you get it to work okay?
    • I downloaded the psexec tools as my dependency... then run the batch file... works fine.. thank you once again...
      • that is the easiest way to run it for what you are doing. PSExec runs it under the specified profile
Please log in to comment
Answer this question or Comment on this question for clarity

Share