Giggo Posted February 22, 2022 Posted February 22, 2022 (edited) i can't open rstrui.exe from script, here is an example but it doesn't work example: #include <GUIConstantsEx.au3> Global $hGui = GUICreate("Form1", 300, 50, -1, -1) Global $Btn1 = GUICtrlCreateButton("Open Rstrui", 100,10, 100, 30) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Btn1 RunWait(@ComSpec & " /c " & "start " & @WindowsDir & "\system32\rstrui.exe", "", @SW_HIDE) EndSwitch WEnd Edited February 22, 2022 by Giggo
Nine Posted February 22, 2022 Posted February 22, 2022 Probably a redirection issue. Try : If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False) Giggo 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Giggo Posted February 22, 2022 Author Posted February 22, 2022 (edited) perfect bro... thankssssssss!! #include <GUIConstantsEx.au3> #include <Winapi.au3> Global $hGui = GUICreate("Form1", 300, 50, -1, -1) Global $Btn1 = GUICtrlCreateButton("Open Rstrui", 100,10, 100, 30) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Btn1 If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False) RunWait(@ComSpec & " /c " & "start " & @WindowsDir & "\system32\rstrui.exe", "", @SW_HIDE) EndSwitch WEnd add your code to me script expandcollapse popup#RequireAdmin #The shutdown code is a combination of the following values: #0 = Logoff #1 = Shutdown #2 = Reboot #4 = Force #8 = Power down #16= Force if hung #32= Standby #64= Hibernate ;Run("control.exe sysdm.cpl,,4") ;Pannello di controllo ecc #include <ScreenCapture.au3> #include <Process.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <EventLog.au3> #include <File.au3> #include <process.au3> #include <WinApi.au3> $Form1 = GUICreate("Form1", 615, 437, 415, 393) $BtnFortnite = GUICtrlCreateButton("Chiudi Fortnite", 5, 305, 145, 49) $BtnChrome = GUICtrlCreateButton('Chiudi Chorme', 5, 5, 145, 49) $BtnBlueStacks = GUICtrlCreateButton('Chiudi Blue Stacks', 5, 55, 145, 49) $BtnClearTemp = GUICtrlCreateButton('Cancella Temp', 5, 105, 145, 49) $BtnDisconnetti = GUICtrlCreateButton('Disconnetti PC', 5, 155, 145, 49) $BtnRiavvia = GUICtrlCreateButton('Riavvia PC', 5, 205, 145, 49) $BtnSpegni = GUICtrlCreateButton('Spegni PC', 5, 255, 145, 49) $BtnPuliziaDisco = GUICtrlCreateButton('Pulizia Disco', 5, 355, 145, 49) $BtnGoogleMyActivity = GUICtrlCreateButton('Google Activity', 305, 5, 145, 49) $BtnControlPanel = GUICtrlCreateButton('Pannello di controllo', 305, 55, 145, 49) $BtnScreenCapture = GUICtrlCreateButton('Cattura Schermo', 305, 105, 145, 49) $BtnRestartDesktop = GUICtrlCreateButton('Restart Desktop', 305, 155, 145, 49) $BtnRipristinoDiSistema= GUICtrlCreateButton('Apri Ripristino', 305, 205, 145, 49) If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False) $x = 0 GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Exit Case $BtnRestartDesktop RunWait(@ComSpec & " /c " & "taskkill /f /im explorer.exe", "", @SW_HIDE) ; close desktop RunWait(@ComSpec & " /c " & "start " & @WindowsDir & "\explorer.exe", "", @SW_HIDE) ; restart desktop Case $BtnScreenCapture $x = $x + 1 _ScreenCapture_Capture(@desktopdir & "\Screenshot" & $x & ".jpg" , 0, 0, 1920, 1080) Case $BtnControlPanel Run("control.exe") Case $BtnRipristinoDiSistema RunWait(@ComSpec & " /c " & "start " & @WindowsDir & "\system32\rstrui.exe", "", @SW_HIDE) Case $BtnFortnite RunWait(@ComSpec & " /c " & "taskkill /F /IM EpicGamesLauncher.exe", "", @SW_HIDE) ; close desktop RunWait(@ComSpec & " /c " & "taskkill /F /IM FortniteClient-Win64-Shipping.exe", "", @SW_HIDE) RunWait(@ComSpec & " /c " & "taskkill /F /IM FortniteClient-Win64-Shipping_EAC.exe", "", @SW_HIDE) RunWait(@ComSpec & " /c " & "taskkill /F /IM FortniteLauncher.exe", "", @SW_HIDE) RunWait(@ComSpec & " /c " & "taskkill /F /IM GameBarPresenceWriter.exe", "", @SW_HIDE) RunWait(@ComSpec & " /c " & "taskkill /F /IM LCore.exe", "", @SW_HIDE) RunWait(@ComSpec & " /c " & "taskkill /F /IM logitechg_discord.exe", "", @SW_HIDE) case $BtnGoogleMyActivity ShellExecute("https://myactivity.google.com/myactivity") Case $BtnSpegni Shutdown(1) Case $BtnPuliziaDisco ShellExecuteWait("cleanmgr.exe") Case $BtnRiavvia Shutdown(2) Case $BtnChrome RunWait(@ComSpec & " /c " & "taskkill /F /IM chrome.exe", "", @SW_HIDE) Case $BtnBlueStacks RunWait(@ComSpec & " /c " & "taskkill /F /IM BlueStacks.exe", "", @SW_HIDE) RunWait(@ComSpec & " /c " & "taskkill /F /IM HD-Player.exe", "", @SW_HIDE) RunWait(@ComSpec & " /c " & "taskkill /F /IM HD-Agent.exe", "", @SW_HIDE) RunWait(@ComSpec & " /c " & "taskkill /F /IM BstkSVC.exe", "", @SW_HIDE) Case $BtnDisconnetti Shutdown(0) Case $BtnClearTemp $aFolders = _FileListToArray(@TempDir, "*", $FLTA_FOLDERS, True) $aFiles = _FileListToArray(@TempDir, "*", $FLTA_FILES, True) If IsArray($aFolders) Then For $i = 1 To $aFolders[0] DirRemove($aFolders[$i], 1) Next EndIf If IsArray($aFiles) Then For $x = 1 To $aFiles[0] If Not StringInStr($aFiles[$x], "FXSAPI") Then FileDelete($aFiles[$x]) Next EndIf EndSwitch WEnd I hope everything is fine Edited February 22, 2022 by Giggo
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now