
e45678mail
Members-
Posts
8 -
Joined
-
Last visited
Recent Profile Visitors
128 profile views
e45678mail's Achievements

Seeker (1/7)
0
Reputation
-
Hi~ I have some question about how to enable the test mode via "Run" or "shellexecute" of command, was to tried : ----- Run("bcdedit.exe /-set testsinging on", "C:\Windows\System32") and shellexecute("bcdedit.exe /-set testsinging on", "C:\Windows\System32") ----- since this command must to run through administrator competence, have any method can accomplish it?
-
(Solved)Why the .exe file will not auto run?
e45678mail replied to e45678mail's topic in AutoIt General Help and Support
I am add the auto run by registry as: RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",@ScriptName,"REG_SZ",$ATPath) and copy the .exe file to startup folder by shell:startup. all of script as below: #RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=y #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Change2CUI=y #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Process.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=d:\ian_chen\Desktop\Auto Install\AutoInstall_v0.2.kxf $Form1 = GUICreate("AutoInstall v1.0_1223", 601, 513, 187, 126) GUISetFont(8, 400, 0, "Calibri") $Radio1 = GUICtrlCreateRadio("All", 32, 456, 75, 35) GUICtrlSetFont(-1, 12, 400, 0, "Calibri") $Radio2 = GUICtrlCreateRadio("Clean", 176, 456, 75, 35) GUICtrlSetFont(-1, 12, 400, 0, "Calibri") $Group1 = GUICtrlCreateGroup("", 8, 442, 292, 58) GUICtrlSetFont(-1, 12, 400, 0, "Calibri") GUICtrlCreateGroup("", -99, -99, 1, 1) $Install = GUICtrlCreateButton("Install All", 384, 455, 171, 41) GUICtrlSetFont(-1, 12, 400, 0, "Calibri") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $ip = 0 Local $id = 0 local $ini = FileRead(".\autoins.ini") local $sDev = StringInStr($ini,"DeviceCount=") local $Dev = StringMid($ini,($sDev+12),2) local $sOpt = StringInStr($ini,"OptionCount=") local $Opt = StringMid($ini,($sOpt+12),2) Local $TT = $Dev+$Opt While $ip <= $TT If $ip <= $dev Then Local $FDevice = StringInStr($ini,"Device"&($ip-1)) local $spath = StringInStr($ini,"path","",1,$FDevice) local $epath = StringInStr($ini,".","",1,$spath+15) local $path = StringMid($ini,($spath+6),($epath-$spath-2)) Local $rpath = StringReplace($path,"\\","\") local $Label = ("$Label"&$ip) $Label = GUICtrlCreateLabel($rpath, 300, 430/$TT*($ip-1)+8, 280, 19) GUICtrlSetFont(-1, 10, 400, 0, "Calibri") $ip = $ip + 1 EndIf If $ip > $dev Then Local $FDevice = StringInStr($ini,"Option"&($ip-$dev-1)) local $spath = StringInStr($ini,"path","",1,$FDevice) local $epath = StringInStr($ini,".","",1,$spath+15) local $path = StringMid($ini,($spath+6),($epath-$spath-2)) Local $rpath = StringReplace($path,"\\","\") local $Label = ("$Label"&$ip) $Label = GUICtrlCreateLabel($rpath, 300, 430/$TT*($ip-1)+8, 280, 19) GUICtrlSetFont(-1, 10, 400, 0, "Calibri") $ip = $ip + 1 EndIf WEnd While $id <= $TT If $id <= $dev Then Local $FDevice = StringInStr($ini,"Device"&($id-1)) local $sname = StringInStr($ini,"Name","",1,$FDevice) local $ename = StringInStr($ini,'"',"",1,$sname+20) local $name = StringMid($ini,($sname+10),($ename-$sname-10)) local $Checkbox = ("$Checkbox"&$id) $Checkbox = GUICtrlCreateCheckbox($name, 10, 430/$TT*($id-1)+8, 280, 20) GUICtrlSetFont(-1, 10, 400, 0, "Calibri") if StringInStr($name,"control") > 0 Then GUICtrlSetState(-1,$GUI_DISABLE) EndIf if StringInStr($name,"Hotkey") > 0 Then GUICtrlSetState(-1,$GUI_DISABLE) EndIf $id = $id + 1 EndIf If $id > $dev Then Local $FDevice = StringInStr($ini,"Option"&($id-$dev-1)) local $sname = StringInStr($ini,"Name","",1,$FDevice) local $ename = StringInStr($ini,'"',"",1,$sname+20) local $name = StringMid($ini,($sname+10),($ename-$sname-10)) local $Checkbox = ("$Checkbox"&$id) $Checkbox = GUICtrlCreateCheckbox($name, 10, 430/$TT*($id-1)+8, 280, 20) GUICtrlSetFont(-1, 10, 400, 0, "Calibri") if StringInStr($name,"WLAN") > 0 Then GUICtrlSetState(-1,$GUI_DISABLE) EndIf if StringInStr($name,"BT") > 0 Then GUICtrlSetState(-1,$GUI_DISABLE) EndIf if StringInStr($name,"Blue") > 0 Then GUICtrlSetState(-1,$GUI_DISABLE) EndIf $id = $id + 1 EndIf WEnd IF StringLen(RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT")) <= 1 Then Normal() Else continue() EndIf Func Normal() While 1 $nMsg = GUIGetMsg() Switch $nMsg case $Radio1 Local $CBIT = $TT+9 Local $i = $CBIT+$TT While $CBIT <= $i GUICtrlSetState($CBIT,$GUI_CHECKED) if StringInStr(GUICtrlRead($CBIT,1),"Control") > 0 Then GUICtrlSetState($CBIT,$GUI_UNCHECKED) EndIf if StringInStr(GUICtrlRead($CBIT,1),"Honkey") > 0 Then GUICtrlSetState($CBIT,$GUI_UNCHECKED) EndIf if StringInStr(GUICtrlRead($CBIT,1),"WLAN") > 0 Then GUICtrlSetState($CBIT,$GUI_UNCHECKED) EndIf if StringInStr(GUICtrlRead($CBIT,1),"BT") > 0 Then GUICtrlSetState($CBIT,$GUI_UNCHECKED) EndIf if StringInStr(GUICtrlRead($CBIT,1),"Blue") > 0 Then GUICtrlSetState($CBIT,$GUI_UNCHECKED) EndIf $CBIT = $CBIT+1 WEnd case $Radio2 Local $CBIT = $TT+9 Local $i = $CBIT+$TT While $CBIT <= $i GUICtrlSetState($CBIT,$GUI_UNCHECKED) $CBIT = $CBIT+1 WEnd Case $GUI_EVENT_CLOSE Exit case $Install GUICtrlSetState($install,$GUI_DISABLE) Local $LBIT = 8 Local $i = $LBIT+$TT Local $CBIT = $TT+9 Local $OrderC = "" Local $OrderL = "" Local $k = "" Local $L = "" Local $ATPath = @ScriptDir&"\"&@ScriptName RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",@ScriptName,"REG_SZ",$ATPath) While $LBIT <= $i if GUICtrlRead($CBIT)= $gui_checked Then $orderC = $orderC & $CBIT &"_" $orderL = $orderL & $LBIT &"_" EndIf $LBIT = $LBIT +1 $CBIT = $CBIT+1 WEnd RegWrite("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT","REG_SZ",$orderC) RegWrite("HKEY_CURRENT_USER\SOFTWARE\iAN","LBIT","REG_SZ",$orderL) Local $LBIT = 8 Local $i = $LBIT+$TT Local $CBIT = $TT+9 While $LBIT <= $i Local $rpath = GUICtrlRead($LBIT,0) Local $test =StringRight($rpath,3) if GUICtrlRead($CBIT)= $gui_checked Then switch $test Case "exe" ShellExecuteWait(@ScriptDir&"\"&$rpath,"-s") $orderC = RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT") $orderL = RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","LBIT") $k = StringMid($orderC,stringinstr($orderC,"_")+1,99) $L = StringMid($orderL,stringinstr($orderL,"_")+1,99) RegWrite("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT","REG_SZ",$k) RegWrite("HKEY_CURRENT_USER\SOFTWARE\iAN","LBIT","REG_SZ",$L) Sleep(3000) case "msi" ShellExecuteWait(@ScriptDir&"\"&StringReplace($rpath,"msiexec.exe /i ",""),"-qn") $orderC = RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT") $orderL = RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","LBIT") $k = StringMid($orderC,stringinstr($orderC,"_")+1,99) $L = StringMid($orderL,stringinstr($orderL,"_")+1,99) RegWrite("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT","REG_SZ",$k) RegWrite("HKEY_CURRENT_USER\SOFTWARE\iAN","LBIT","REG_SZ",$L) Sleep(3000) EndSwitch EndIf $LBIT = $LBIT +1 $CBIT = $CBIT+1 wend GUICtrlSetState($install,$GUI_ENABLE) MsgBox(0,"","Completed!!") Run("C:\Windows\System32\control.exe appwiz.cpl", "", @SW_SHOWMAXIMIZED) Sleep(1000) send("{F5}") EndSwitch WEnd EndFunc Func Continue() GUICtrlSetState($install,$GUI_DISABLE) Local $CBITfll = RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT") Local $CBIT = StringLeft($CBITfll,StringInStr($CBITfll,"_")-1) While $CBIT <> "" GUICtrlSetState($CBIT,$GUI_CHECKED) $CBITfll = StringMid($CBITfll,StringInStr(RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT"),"_")+1,99) $CBIT = StringLeft($CBITfll,StringInStr($CBITfll,"_")-1) WEnd Local $CBIT = StringLeft(RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT"),StringInStr(RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT"),"_")-1) Local $LBIT = StringLeft(RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","LBIT"),StringInStr(RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","LBIT"),"_")-1) Local $i = $LBIT+$TT Local $OrderC = "" Local $OrderL = "" Local $k = "" Local $L = "" While $LBIT <= $i Local $rpath = GUICtrlRead($LBIT,0) Local $test =StringRight($rpath,3) if GUICtrlRead($CBIT)= $gui_checked Then switch $test Case "exe" $orderC = RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT") $orderL = RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","LBIT") $k = StringMid($orderC,stringinstr($orderC,"_")+1,99) $L = StringMid($orderL,stringinstr($orderL,"_")+1,99) RegWrite("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT","REG_SZ",$k) RegWrite("HKEY_CURRENT_USER\SOFTWARE\iAN","LBIT","REG_SZ",$L) Sleep(3000) ShellExecuteWait(@ScriptDir&"\"&$rpath,"-s") case "msi" $orderC = RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT") $orderL = RegRead("HKEY_CURRENT_USER\SOFTWARE\iAN","LBIT") $k = StringMid($orderC,stringinstr($orderC,"_")+1,99) $L = StringMid($orderL,stringinstr($orderL,"_")+1,99) RegWrite("HKEY_CURRENT_USER\SOFTWARE\iAN","CBIT","REG_SZ",$k) RegWrite("HKEY_CURRENT_USER\SOFTWARE\iAN","LBIT","REG_SZ",$L) Sleep(3000) ShellExecuteWait(@ScriptDir&"\"&StringReplace($rpath,"msiexec.exe /i ",""),"-qn") EndSwitch EndIf $LBIT = $LBIT +1 $CBIT = $CBIT+1 wend GUICtrlSetState($install,$GUI_ENABLE) MsgBox(0,"","Completed!!") Run("C:\Windows\System32\control.exe appwiz.cpl", "", @SW_SHOWMAXIMIZED) Sleep(1000) send("{F5}") While 1 $nMsg = GUIGetMsg() Switch $nMsg case $Radio1 Local $CBIT = $TT+9 Local $i = $CBIT+$TT While $CBIT <= $i GUICtrlSetState($CBIT,$GUI_CHECKED) if StringInStr(GUICtrlRead($CBIT,1),"Control") > 0 Then GUICtrlSetState($CBIT,$GUI_UNCHECKED) EndIf if StringInStr(GUICtrlRead($CBIT,1),"Honkey") > 0 Then GUICtrlSetState($CBIT,$GUI_UNCHECKED) EndIf if StringInStr(GUICtrlRead($CBIT,1),"WLAN") > 0 Then GUICtrlSetState($CBIT,$GUI_UNCHECKED) EndIf if StringInStr(GUICtrlRead($CBIT,1),"BT") > 0 Then GUICtrlSetState($CBIT,$GUI_UNCHECKED) EndIf if StringInStr(GUICtrlRead($CBIT,1),"Blue") > 0 Then GUICtrlSetState($CBIT,$GUI_UNCHECKED) EndIf $CBIT = $CBIT+1 WEnd case $Radio2 Local $CBIT = $TT+9 Local $i = $CBIT+$TT While $CBIT <= $i GUICtrlSetState($CBIT,$GUI_UNCHECKED) $CBIT = $CBIT+1 WEnd Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc -
(Solved)Why the .exe file will not auto run?
e45678mail replied to e45678mail's topic in AutoIt General Help and Support
thanks for your suggestion, I was to disable the Defender by gpedit.msc or add my .exe file to exclusions list, still will not popup the UI of my .exe when reboot. -
I have put the compiled file of EXE path to : HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run or startup folder. why the system always will not auto run it when reboot, but .au3 format will function it? =>Thanks all, I have find the root cause is #requireAdmin cmd, remove it function will normally.
-
I am begineer, used the command Run Winactive can't open that "Change Action Center Setting" windows, and I want to disable each setting about that, Ex: Windows Update, SmartScreen, File History... Have any master can teach me about how to: A.open "Change Action Center Setting" windows, and uncheck each option by script. B.To disable above option via .reg?