Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Continue after reboot


  • Please log in to reply
13 replies to this topic

#1 willichan

willichan

    Go ahead. You know you want to scan it.

  • Active Members
  • PipPipPipPipPipPip
  • 734 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

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,562 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()_ConvertLHWebColor()/_ConvertSHWebColor()_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()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_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()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#3 willichan

willichan

    Go ahead. You know you want to scan it.

  • Active Members
  • PipPipPipPipPipPip
  • 734 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,992 posts

Posted 29 December 2011 - 07:37 AM

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

If Ive just helped you ... miracles do happen. Chimaera 

 

CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices()


#5 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,562 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()_ConvertLHWebColor()/_ConvertSHWebColor()_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()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_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()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#6 willichan

willichan

    Go ahead. You know you want to scan it.

  • Active Members
  • PipPipPipPipPipPip
  • 734 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

    I'm back ... I miss, why not!

  • Active Members
  • PipPipPipPipPipPip
  • 1,231 posts

Posted 29 December 2011 - 11:11 PM

Very nice, thanks for sharing!!!

Regards,

João Carlos.
http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

dropbo10.pngDownload 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

    Go ahead. You know you want to scan it.

  • Active Members
  • PipPipPipPipPipPip
  • 734 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.

#10 itmajor

itmajor

    Seeker

  • Normal Members
  • 1 posts

Posted 23 October 2014 - 08:58 PM

Nice post. I was wondering how would you edit script #1 to remove versioning, but keep everything else. For example, I still want it to go through all the stages instead of going straight to stage 3 (based on your example).



#11 willichan

willichan

    Go ahead. You know you want to scan it.

  • Active Members
  • PipPipPipPipPipPip
  • 734 posts

Posted 23 October 2014 - 10:02 PM

That kind of defeats the purpose of the script.  The idea behind this script is to be able to continue where you left off after a reboot.

If you want to start from stage one every time you can just call a regular script?

 

Or am I misunderstanding your question?



#12 step887

step887

    Wayfarer

  • Active Members
  • Pip
  • 90 posts

Posted 23 October 2014 - 11:33 PM

So I just saw this and I have not tested, but reading through the code, I have a couple questions.

 

How do you autostart the app on reboot? Do you have UAC enabled? 

 



#13 willichan

willichan

    Go ahead. You know you want to scan it.

  • Active Members
  • PipPipPipPipPipPip
  • 734 posts

Posted 25 October 2014 - 01:50 AM

We have UAC turned off for all of our machines, and have a special domain account set up for doing our cleanups.  It has sufficient rights for all of the tasks needed, and has the cleanup script followed by a mandatory reboot in its login script.  That way, we just log in, and walk on to the next PC.  Then cycle back after covering the floor to make sure the script completed.



#14 jdelaney

jdelaney

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 2,120 posts

Posted 27 October 2014 - 10:21 PM

Nice.  Did not know about ther userinit registry key.  I always over complicated things with scheduled tasks creation|deletes.


Edited by jdelaney, 27 October 2014 - 10:21 PM.

IEbyXPATH-Grab IE DOM objects by XPATH
IEscriptRecord-Makings of an IE script recorder
ExcelFromXML-Create Excel docs without excel installed
GetAllWindowControls-Output all control data on a given window.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users