batch file but requires an "Administrator" account privillege
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
Answers (2)
Please log in to answer
Posted by:
SMal.tmcc
9 years ago
If you run the batch as a kscript you can put in the admin credentials or just let it run as system.
Comments:
-
I am already using kscript...where can I put my admin credentials? - jaimec 9 years ago
-
see above - SMal.tmcc 9 years ago
-
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 - jaimec 9 years ago
-
Enter the Admin credentials in the "Run As User" boxes - rockhead44 9 years ago
-
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. - jaimec 9 years ago
-
can you post your batch file? - SMal.tmcc 9 years ago
-
@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 - jaimec 9 years ago -
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 - SMal.tmcc 9 years ago -
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 - SMal.tmcc 9 years ago