Jump to content



Photo

Continue after reboot


  • Please log in to reply
8 replies to this topic

#1 willichan

willichan

    Old Geek

  • Active Members
  • PipPipPipPipPipPip
  • 390 posts

Posted 18 February 2011 - 07:48 PM

I have seen a few requests for the ability to continue a script after a reboot. I do this all the time, especially during holiday shutdown each year when I have a laundry list of tasks to perform on all systems. I have had as many as 40+ tasks, many of which reboot themselves, or won't continue if they see another installation that has not reboot yet (gotta love Microsoft).

Here is the shell script that I used to get it done.

Version 1
Spoiler


------
Here's my new version. Some people had trouble remembering not to skip numbers, or to keep them in order, so this one puts it all in an array, so you don't have to manually keep track of task IDs.

Version 2
Spoiler


------
MSUpdates Module
Spoiler


--Edit--
Added Version 2 of script
modified log path in Version 2 (see posts 5&6)
Added MSUpdates module

Edited by willichan, 30 December 2011 - 05:43 PM.

  • notime likes this





#2 guinness

guinness

    guinness

  • MVPs
  • 10,353 posts

Posted 18 February 2011 - 08:29 PM

Nice! Haven't tested yet but I did something similar too.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#3 willichan

willichan

    Old Geek

  • Active Members
  • PipPipPipPipPipPip
  • 390 posts

Posted 28 December 2011 - 09:24 PM

I did a rewrite of this shell to accommodate some people that were editing my scripts, but couldn't remember to keep tasks IDs consecutive. This new one is going into use for 2011 end-of-year cleanup. See post #1 for both versions.

#4 Chimaera

Chimaera

    Sorry .. Where am i again?

  • Active Members
  • PipPipPipPipPipPip
  • 1,520 posts

Posted 29 December 2011 - 07:37 AM

Thanks for sharing, ill have a look and report back.

#5 guinness

guinness

    guinness

  • MVPs
  • 10,353 posts

Posted 29 December 2011 - 08:28 AM

I personally wouldn't hard-code the C: drive destination but instead opt for saving to a different location such as @AppDataCommonDir.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#6 willichan

willichan

    Old Geek

  • Active Members
  • PipPipPipPipPipPip
  • 390 posts

Posted 29 December 2011 - 04:30 PM

I personally wouldn't hard-code the C: drive


I agree with you. This script comes from an internal end-of-year cleanup script, and the log file location was decided on "by committee", and gets deleted in a few days anyway. I'll change it in the top post though, when I get a few minutes this morning.

#7 JScript

JScript

    Goodbye everybody, I got tired of this system adopted here!

  • Active Members
  • PipPipPipPipPipPip
  • 1,062 posts

Posted 29 December 2011 - 11:11 PM

Very nice, thanks for sharing!!!

Regards,

João Carlos.
http://notebook.forumais.com (Forum Maintenance Notebooks and Desktop)http://autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

Posted Image Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!       


#8 engjcowi

engjcowi

    Polymath

  • Active Members
  • PipPipPipPip
  • 245 posts

Posted 30 December 2011 - 01:28 PM

Great stuff look forward to testing
Drunken Frat-Boy Monkey Garbage

#9 willichan

willichan

    Old Geek

  • Active Members
  • PipPipPipPipPipPip
  • 390 posts

Posted 30 December 2011 - 05:48 PM

Ok. I have had alot of people contacting me, both from the forum and from without, wanting the MS Updates script. I went ahead added it to post #1.
I am glad to see that so many people are able to make use of this shell script.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users