Jump to content


semoca

Established Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by semoca

  1. Hi, I've tried to add the timer to the HTA file for the 'Upgrade now' button but it failed. Could you please advise? Sub run_vbscript_button         Dim oShell, scriptPath, appCmd         Set oShell  = CreateObject("WScript.Shell")         UpgradeLog.WriteLine TimeStamp & " " & "Upgrade tonight,New Sub running"              'window.resizeTo 500,450                 call ResizeWindow(425,335,500,535)                 Window.moveTo 100,100             ' check if timer value exists              str = ReadReg ("HKEY_CURRENT_USER\SOFTWARE\windows-noob\Timer")                 If str = "NotFound" then                     'msgbox "timer value was not found, setting default value"                     UpgradeLog.WriteLine TimeStamp & " " & "Timer value not found in registry, setting to default value"                      pbWaitTime        = 120    ' How many seconds the progress bar lasts (2 mins)                 else                     'msgbox "Found timer value: " & str                     UpgradeLog.WriteLine TimeStamp & " " & "Timer value found in registry, converting it to seconds"                      ' convert it to seconds                     pbWaitTime = HMStoSec(str) ' How many seconds the progress bar lasts                     UpgradeLog.WriteLine TimeStamp & " " & "Timer value = " & str                 End If                              ' Progress Bar Settings 2 mins below                 pbHeight        = 10        ' Progress bar height                 pbWidth            = 380        ' Progress bar width                 pbUnloadedColor    ="white"    ' Color of unloaded area                 pbLoadedColor    ="black"    ' Color of loaded area                 pbBorder        ="grey"        ' Color of Progress bar border                                  ' Don't edit these things                 pbStartTime = Now                 rProgressbar                 pbTimerID = window.setInterval("rProgressbar", 200)                 if DateDiff("s",pbStartTime,Now) >= pbWaitTime then                  UpgradeLog.WriteLine TimeStamp & " " & "The timer has reached 00:00:00 FORCED, passing error code 0 to the Task sequence"                 UpgradeLog.WriteLine TimeStamp & " " & "Either the user accepted the files saving to the H drive check box and clicked Upgrade Now, or the popup ran out of time, see previous line in this log to find out. Starting Task sequence"                  call WriteRegistry("HKCU\Software\windows-noob\UpgradeComputer","Upgrade_Forced")                 call ExitHTA()                 end if
  2. Thanks a lot for sharing this. Amazing job. Would it be difficult to set the task to defer the upgrade process a few hours after the click on the Upgrade button? i.e. Users will click on the 'Upgrade tonight' button and the process will resume after they've left the office for the day Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.