Jump to content

Search the Community

Showing results for tags 'restart'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Member Title




Found 10 results

  1. This is possible? I was trying to use registry edits to set the "last logged user" to make the system reboot into User2 (using Shutdown($SD_REBOOT) ) but it keeps logging back into User 1 when restarting.
  2. So can anyone help me ? I need to restart program when condition is not met ...
  3. Hello forum users! At some point I had a need to restart my script. Is it possible to do this with autoit or do I need to connect additional scripts like .cmd or .bat? For example: i have only script.au3 and it's running. Wich code shoud i use to exit from the script and start it again?
  4. Hi , I wrote a setup function in which the user can change IP or Port of a Server. To make the changes known to the program, it needs to be restarted. But it does not restart. Here is the Function: Func Setup() #Region ### START Koda GUI section # ## Form=c:\users\kg5cwz\desktop\autohotkey\qrz uploader\a2q.kxf $Form1_1 = GUICreate("Station Setup", 615, 328, -1, -1, BitOR($WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_POPUP)) GUISetBkColor(0xA0A0A4) $CS= GUICtrlCreateInput($Callsign, 200, 120, 201, 29) GUICtrlSetFont(-1, 16, 400, 0, "@GungsuhChe") $Key = GUICtrlCreateInput($QRZKey, 200, 167, 233, 29) GUICtrlSetFont(-1, 16, 400, 0, "@GungsuhChe") $IPAddress = GUICtrlCreateInput($ServerIP, 200, 214, 129, 29) GUICtrlSetFont(-1, 16, 400, 0, "@GungsuhChe") $UPort = GUICtrlCreateInput($Port, 200, 264, 57, 29) GUICtrlSetFont(-1, 16, 400, 0, "@GungsuhChe") $Cancel = GUICtrlCreateButton("Cancel", 384, 272, 81, 25) $Save = GUICtrlCreateButton("Save", 504, 272, 81, 25) $INFO = GUICtrlCreateLabel("A2Q Station Setup", 88, 32, 429, 51) GUICtrlSetFont(-1, 35, 800, 0, "@GungsuhChe") $Icon1 = GUICtrlCreateIcon(".\1475471331_marine_radio.ico", -1, 464, 112, 129, 113) $Label1 = GUICtrlCreateLabel("Callsign:", 24, 120, 130, 31) GUICtrlSetFont(-1, 20, 400, 0, "@GungsuhChe") $Label2 = GUICtrlCreateLabel("QRZ Key:", 25, 166, 116, 31) GUICtrlSetFont(-1, 20, 400, 0, "@GungsuhChe") $Label3 = GUICtrlCreateLabel("IP Address:", 24, 215, 158, 31) GUICtrlSetFont(-1, 20, 400, 0, "@GungsuhChe") $Label4 = GUICtrlCreateLabel("Port:", 26, 261, 74, 31) GUICtrlSetFont(-1, 20, 400, 0, "@GungsuhChe") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Cancel GUIDelete($Form1_1) ExitLoop Case $Save Global $hFileOpen = FileOpen("Setup.txt", 2) $Callsign = StringUpper(GUICtrlRead($CS)) $QRZKey= StringUpper(GUICtrlRead($Key)) $ServerIP = GUICtrlRead($IPAddress) $Port = GUICtrlRead($Uport) FileWrite($hFileOpen, StringUpper($Callsign) & @CRLF) FileWrite($hFileOpen, StringUpper($QRZKey) & @CRLF) FileWrite($hFileOpen, $ServerIP & @CRLF) FileWrite($hFileopen, $Port) FileClose($hFileOpen) ; End write Setup file GUIDelete($Form1_1) If @Compiled Then Run("A2Q.exe" & "/RESTART");just run the exe Else $AutoIt3Path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "betaInstallDir");installDir for beta $AutoIt3Path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir");installDir for production $ToRun1 = '"' & $AutoIt3Path & '\AutoIt3.exe "' & ' "' & @ScriptFullPath & '"' ConsoleWrite($ToRun1 & @CRLF);to test we have got it right Run($ToRun1) EndIf EndSwitch WEnd EndFunc Func Help() MsgBox(64,"Help","Press:" &@CRLF & @CRLF &"ALT-Shift-S = Setup." & @CRLF & "Shift-ESC = Exit") EndFunc A2Qis an .EXE. For now I have to manually exit it and then do a restart. I also tried RUN(".\A2Q.exe" & " /RESTART") and the @filepath thingy. I can not get the script to restart itself :-( Any ideas? Thanks for any help. KF5WGB
  5. hey I wonder if there is a possibility to do this in Autoit ? I've to make sure that my application is closed properly to prevent crahses / errors in VB.NET I was able to do it by : AddHandler Microsoft.Win32.SystemEvents.SessionEnding, AddressOf myfunctions_end_mywork I found an old example here : but its not working
  6. So I made a loop beginning with while $e = 1. It opens a file and searches for a colour in the file, if the colour isn't there $e = 2 so the loop ends and restarts. Instead of that, the loop runs once and then just stops completely, even if the colour is there. Here is what it looks like basically. While $e = 1 OpenPng() $aCoord = PixelSearch ($left, $top, $right, $bottom, 0x3B5E05, 0) If @error Then $e = 2 WEnd How do I make it so the loop restarts if the colour isn't there, but it continues normally if the colour is there?
  7. I want to restart a program, if the window or process closes, the program gets crashed and so on. I used Runwait in a While loop, that worked so far really good. Now I got the problem that Windows sometimes does show me this window http://i.stack.imgur.com/4bCtC.png it is not excatly that one but looks close to it. So I want to close that window immidiatly if it appears.
  8. Good day. I'm scripting Photoshop install. After the install is done, Photoshop may call for a system reboot. Problem is - there is still a bunch of stuff I'd like to do before that. So I need a UDF that would delay restart until the script finishes, or any advice on how to do it will work just as well. Tried OnAutoItExitRegister, but it delays reboot for XP only. I've searched the forum, but failed to find a really reliable UDF that'd work on Win7. I could have easily overlooked, I'm relatively new, thats why I'm asking for help. Thanks in advance.
  9. Well, I am pretty sure this is possible. I have seen many solutions for this, but I couldn't understand how to configurate it. I have a Minecraft CraftBukkit server, but I want to automatize it a bit. Something like this: 10:00: Wake up pc from hybernating, and start 2 servers (they have both this CMD "gui"). After starting: Type 'save-all' (without the quotes) in both CMD's every 15 minutes until 13:00 13:00: Type 'broadcast Restarting server!' in both CMD's 13:02: Type 'stop' in both CMD's 13:04: Press the ENTER button in both CMD's, wait 5 seconds and restart the pc. After restart: Start both servers. After starting: Type 'save-all' in both CMD's every 15 minutes until 16:00 16:00: Type 'broadcast Restarting server!' in both CMD's 16:02: Type 'stop' in both CMD's 13:04: Press the ENTER button in both CMD's, wait 5 seconds and restart the pc. After restart: Start both servers. After starting: Type 'save-all' in both CMD's every 15 minutes until 20:00 20:00 Type 'broadcast Restarting server!' in both CMD's 20:02 Type 'stop' in both CMD's 20:04: Press the ENTER button in both CMD's, wait 5 seconds and restart the pc. After restart: start both servers. After starting: Type 'save-all' every 15 minutes in both CMD's until 01:00 01:00 Type 'broadcast STOPPING SERVER!' in both CMD's 01:02 Type 'stop' in both CMD's 01:04 Press the ENTER button in both CMD's, wait 5 seconds and set the pc to hybernate, and repeat the sequence (the pc wakes up at 10:00 again). What I would like, is a clear optin/config in the beginning of the file or something where I can set when the server should start and stop (e.g $start=10:00; $stop=01:00) and when it should restart (e.g $restart=13:00;16:00;20:00) if that is possible. If anyone can make a script like that for me, then I would be very happy. I have never used AutoIt before, I was just recommended by a friend about it. -CasterAnd
  10. First off I tried searching both the forums and the help file and I just know it's in one of them. If somebody could please help me find it I would be much grateful. Simply put, I am trying to increment a number that is read from an ini file. The script is to read the initial value, add one to it, and save the new value. The area dealing with this is the last line of code below. Here is my code: #Include <Restart.au3> Global $CommandIni = "DropRun.ini" ; Check that CommandIni exists, if not create file with default values. If FileExists($CommandIni) Then Global $Commands = IniReadSection($CommandIni, @ComputerName) IniWrite($CommandIni, @ComputerName & "_Log", "Start", $CommandIni & " found and read.") Else Local $defCmds[2][2] = [ ["Completed", "1"], ["Command1", "cmd.exe"] ] IniWriteSection($CommandIni, @ComputerName, $defCmds, 0) IniWrite($CommandIni, @ComputerName & "_Log", "Error", $CommandIni & " not found. Attempted to create file.") EndIf ; Check if already completed, if not run the commands. If $Commands[1][1] = "0" Then IniWrite($CommandIni, @ComputerName & "_Log", "Reading", "Entered Command section.") For $i = 2 To $Commands[0][0] ; Check if line is commented out. If StringInStr($Commands[$i][0], ";") Then ContinueLoop Local $exitCode = RunWait($Commands[$i][1]) IniWrite($CommandIni, @ComputerName & "_Log", "Command" & $i-1, $exitCode) Next IniWrite($CommandIni, @ComputerName, "Completed", "1") EndIf Sleep(300000) ; Log number of times script restarted. $Restarts = IniRead($CommandIni, @ComputerName & "_Log", "Restarts", "0") IniWrite($CommandIni, @ComputerName & "_Log", "Restarts", $Restarts+1) _ScriptRestart()The script uses the Also, if anybody has suggestions on how to simplify this I'd also greatly appreciate it. P.S. Sorry I couldn't get the code to paste pretty =S
  • Create New...