Jump to content
dreivilo47

[SOLVED] How to solve this problem?

Recommended Posts

dreivilo47

When I use the following code I receive an UAC message:
 

#RequireAdmin
RunWait("msiexec /i winzip205-64.msi /quiet")
Exit

How can I hide (bypass) the UAC message?

Edited by dreivilo47

Share this post


Link to post
Share on other sites
AutoBert

Turn UAC off in registry. A system with enabled UAC allway show a UAC message.

Share this post


Link to post
Share on other sites
dreivilo47
6 minutes ago, AutoBert said:

Turn UAC off in registry. A system with enabled UAC allway show a UAC message.

Thanks for the suggestion AutoBert.
How can I turn off UAC in registry before RunWait and turn it on again after RunWait?

 

Share this post


Link to post
Share on other sites
AutoBert

RegRead and RegWrite are needed. But therefor you need also #RequireAdmin which shows a UAC Message.

Share this post


Link to post
Share on other sites
orbs

@dreivilo47,

this i not a "problem", and you do not "solve" it.

if you hate UAC on your own machine, then by all means suppress it as suggested (although that may cause other issues). but that is not the case, is it?

to perform an administrative task by a script, then before you begin, make sure your script runs with administrative rights in effect. how you do that depends on your system/network configuration. for examples, you can remotely create a scheduled task to run with the target local SYSTEM account; you can do it with PsExec; you can make use of a deployment tool installed in your network; you can write a background agent to do that; etc.

if you describe your environment, we can suggest the preferred method.

Share this post


Link to post
Share on other sites
dreivilo47
On 27-8-2016 at 11:28 AM, AutoBert said:

Turn UAC off in registry. A system with enabled UAC allway show a UAC message.

@AutoBert, turning off UAC in registry (change value EnableLUA to 0) needs a reboot before it works.  I want to avoid that.

Share this post


Link to post
Share on other sites
dreivilo47
On 27-8-2016 at 0:18 PM, orbs said:

@dreivilo47,

this i not a "problem", and you do not "solve" it.

if you hate UAC on your own machine, then by all means suppress it as suggested (although that may cause other issues). but that is not the case, is it?

to perform an administrative task by a script, then before you begin, make sure your script runs with administrative rights in effect. how you do that depends on your system/network configuration. for examples, you can remotely create a scheduled task to run with the target local SYSTEM account; you can do it with PsExec; you can make use of a deployment tool installed in your network; you can write a background agent to do that; etc.

if you describe your environment, we can suggest the preferred method.

@orbs, in a couple of weeks I need to install software on more than 100 new laptops.  And I want to automate that so it can be done faster.
These laptops are not connected to a network, so I want to use an USB flash drive with the software on it.
I don't hate UAC, but I want to suppress the uac prompt because it becomes irritant after doing a lot of computers.  It slows down.

Share this post


Link to post
Share on other sites
dreivilo47

@orbs, how you do that (in a post) the username beginning with an @ is highlighted?  :)

Share this post


Link to post
Share on other sites
orbs
2 hours ago, dreivilo47 said:

@orbs, how you do that (in a post) the username beginning with an @ is highlighted?  :)

sometimes it works, sometimes it doesn't. this version of the forum software is somewhat crappy.

2 hours ago, dreivilo47 said:

in a couple of weeks I need to install software on more than 100 new laptops.  And I want to automate that so it can be done faster.
These laptops are not connected to a network, so I want to use an USB flash drive with the software on it.

since anyway you are going to plug it in, open the folder, double-click the setup file, and press a few [Next] buttons... i see no reason that one more click should discourage you. especially if working around that single click is probably the most troublesome piece of action to automate, in your case. if this is a one-off operation, and these laptops are fire-and-forget (i.e. you do not keep maintaining them centrally), then i advise you just accept the UAC as it is.

but, you can also get adventurous. you have a couple of weeks to prepare. answer this: are all of those laptops configured with an enabled, password-protected administrative account?

if so, here's what you can consider:

prepare a small network: 8-port switch, one Windows machine, a DHCP service, and an empty desk fitting for 7 laptops.

configure said Windows machine as follows: it constantly monitoring the LAN, whenever a new IP is discovered, it connects to it over PsExec with said admin account to perform the installation. when installation done, it checks if it was successful. if so, it sends a power-off command to the target.

what you do is this: unpack a laptop, connect it to the network, power it on. visit the laptop after few minutes. if it is shut down, repack it and ship to end user (or, randomly picking, disconnect from network, power on and validate the installation yourself). if it is not shut down, then something went wrong with the installation, check the cause or just install manually. you can do several laptops simultaneously like that.

good luck!

 

 

 

 

 

Share this post


Link to post
Share on other sites
dreivilo47

@orbs,
- Good to know about the username beginning with an "@".
- You're right, I am going to accept the UAC as it is.
- I don't know of all of them are configured with an enabled, password-protected administrative account.
- Thank you very much for the information about the small network!

Edited by dreivilo47

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • dwaynek
      By dwaynek
      traytip isn't working in windows 10. nothing happens when i use the Traytip command.
      here's a simple script i used:
      TrayTip("I'm a title", "I'm the message", 5) i tried changing the registry setting HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced ( which didn't have EnableBalloonTips) and creating a DWORD entry called EnableBalloonTips and setting it to 1 and logging off then back in. that did not resolve the problem.
      i'm running Windows 10 v1709 b16299.431
    • antonioj84
      By antonioj84
      Hi all to the forum guru and expert I am trying to  automate this. in the registry  I have the network profile name network 2 and network   I want to  change their  CATEGORY  to Private .  Can someone lead me in the right direction.
      Private is 1 and Public is 0
      #RequireAdmin Global $sHKLMRoot = @OSArch = "x64" ? "HKLM64" : "HKLM" RegWrite($sHKLMRoot &"\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\NewNetworks" ,'/v NetworkList /t REG_MULTI_SZ /d 00000000 /f') see  attached picture below
      Much appreaciate
       

    • griefman
      By griefman
      Hi everyone,
      i am writing to you after a very long struggle i had while trying to figure out how to send a simple click inside a virtual machine running in vmware workstation 14.
      i have an autoit script running on my host machine watching for the UAC prompt to be displayed in a running vm. Both the host and the guest OS are Windows 10. This script worked perfectly with virtual box. It recognized the UAC prompt and clicked inside and the UAC was accepted. Since i switched to VMware Workstation 14, the script no longer clicks inside the VM successfully. It acts as if it clicks, but it doesn't. 
      I tried sending key combinations instead of a click, so that the VM can grab the input, but it also did not work. Every attempt that i made to send clicks or keys from the host inside the VM did not work. I tried using:
      MouseClick
      ControlClick
      MouseMove
      _WinAPI_Mouse_Event
      _WinAPI_Keybd_Event
       
      I also noticed that while the cursor moves to the target which has to be cilcked when my vmware worstation window is not focused, it even doesn't do that when i WinActivate the vmware workstation window first.
       
      Did anyone experience such an issue, or maybe could give me a hint, what else i could use to send a key combination or a mouse click in a vmware workstation 14 pro guest window?
       
      here is my code, which works with virtualbox:
       
      #AutoIt3Wrapper_Icon=".\uac.ico" #include <ImageSearchSubrogated.au3> FileInstall(".\ImageSearchDLL.dll", ".\ImageSearchDLL.dll", 0) FileInstall(".\UAC_ginloSetup.bmp", ".\UAC_ginloSetup.bmp", 0) FileInstall(".\UAC_Yes.bmp", ".\UAC_Yes.bmp", 0) ; set global variables for the coordinates, which should be delivered global $x1 = 0, $y1 = 0 global $x2 = 0, $y2 = 0 global $counter1 = 0 global $counter2 = 0 global $sleep = 10000 global $smallSleep = 5000 ; execute the script in a loop, so that it will hopefully recover from some unexpected errors While $counter1 < 1 checkForImage() WEnd #cs ------------ Functions #ce ------------ Func checkForImage() While $counter2 < 1 ; search for the UAC in the entire screen - 2 screens supported local $searchUac = _ImageSearchArea('UAC_ginloSetup.bmp', 1, -2568, -8, 5136, 1440, $x1, $y1, 0) If $searchUac = 1 Then ; if the UAC was found search for the Yes button in a an area 200 x 200 from the middle of the found UAC image local $searchYes = _ImageSearchArea('UAC_Yes.bmp', 1, $x1, $y1, $x1 + 200, $y1 + 200, $x2, $y2, 0) If $searchYes = 1 Then ; if the Yes button was found click it and pause the script for $sleep seconds MouseClick("left", $x2, $y2, 1,0) Sleep($sleep) Else ; if the Yes button was not found retry from the beginning in $smallSleep seconds MsgBox(0, "UAC found error", "UAC was found but the 'Yes' button was not found. Script will retry in " & $smallSleep & " seconds.", $smallSleep) EndIf ; another way to accept the UAC - via shortcut ;Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}") ;Send("!y") Else ; if UAC was not found try again in $sleep seconds Sleep($sleep) EndIf WEnd ; if some error occured which expired the loop, pause the script for $sleep seconds MsgBox(0, "Error", "Some Error expired the timer and the script could not recover. The script will restart in " & $sleep & " seconds.", $sleep) EndFunc  
    • PhoenixPRO
      By PhoenixPRO
      When I try to automate this install program I can not get any of the buttons to click with the "ControlClick" function or any mouse movement to move the mouse to the and click it.  My OS is Windows 10 64Bit.  I have tried both 32bit and 64bit installs of Autoit V3 to no avail.
      I could not even get the run command to start the program until I used the variation of the command below in the script.
      With the script below the install program starts but will not click the "Next" button no matter what I do.
      Any help will be greatly appreciated.
      Thanks in advance.
       
      #include <MsgBoxConstants.au3>
      Opt("MouseCoordMode", 0) ;1=absolute, 0=relative to active window, 2=client
      Local $Success
      Run(@ComSpec & " /c " & 'C:\PhoenixPro_Install\RDXUtil\RDX_Tools_setup.exe', "C:\PhoenixPro_Install\RDXUtil", @SW_HIDE )

      WinWait("RDX Tools 1.62 - InstallShield Wizard", "Welcome to the InstallShield Wizard for RDX Tools 1.62")
      WinActivate("RDX Tools 1.62 - InstallShield Wizard", "Welcome to the InstallShield Wizard for RDX Tools 1.62")
      ControlClick ("RDX Tools 1.62 - InstallShield Wizard", "Welcome to the InstallShield Wizard for RDX Tools 1.62", 1639, "left", 1) ;Next Button
    • TheWizEd
      By TheWizEd
      How do I work with 2D arrays.  I've tried this but get errors.
      Local $aTest[4][4] = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]
      ;$aTest[0][] = [10,11,12]  ; Error at []
      Local $sTest = ""
      For $i = 0 To UBound($aTest)-1
        Local $aExtract = _ArrayExtract($aTest,$i,$i)
        $sTest = $sTest & MyTest($aExtract)
      Next
      Func MyTest($aTemp)
        _ArrayDisplay($aTemp)
        ; Error at    v $aTemp
        Return String($aTemp[0]) & " - " & String($aTemp[1]) & " - " & String($aTemp[2]) & @CRLF
      EndFunc
       
       
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.