Jump to content


pkerlin101

Established Members
  • Posts

    2
  • Joined

  • Last visited

pkerlin101's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I have been trying to deploy a package using a task sequence because I want to give the user a notification using Custom Text. The issue here is that when I run the package it reboots the computer after running the install. I am sure it is because the TS is pending reboot to complete but I do not know how to get around it. The package uses the following command to run the msi package. msiexec /i Software.msi /qb /norestart When I just deploy the package the reboot is suppressed as to be expected. I also have noted when the TS is deployed on a computer that already has the version of software I am deploying that it does not reboot the computer and shows the TS complete.
  2. I have a VB script that will so a notification with a countdown timer. The script runs perfectly when ran on XP/WIN7 machines locally. When I try and run the script from an advertisement in SCCM it errors out with a Windows Script Host Error: ActiveX component can't create object Code: 800A01AD. It only errors out on Windows XP machines. The script advertisement works as expected when ran on WIN7 computers. I have also ran the code on the XP machine from the Run command by putting the network location where the script is stored. The code errors out on line 44 char 3 "For Each IE In CreateObject("Shell.Application").windows" ' Script starts here nMinutes = 5 nSeconds = 0 sMessage = "<font color=red size=-1><b>Warning</b></font>" ' Open a chromeless window with message with HTABox("lightgrey", 175, 450, 400, 500) .document.title = "Notification" .msg.innerHTML = sMessage do until .done.value or (nMinutes + nSeconds < 1) .msg.innerHTML = sMessage & "<br>" & nMinutes & ":" & Right("0"&nSeconds, 2) _ & " remaining<br>" wsh.sleep 1000 ' milliseconds nSeconds = nSeconds - 1 if nSeconds < 0 then if nMinutes > 0 then nMinutes = nMinutes - 1 nSeconds = 59 end if end if loop .done.value = true .close end with 'wsh.echo "process goes here ..." ' script ends here Function HTABox(sBgColor, h, w, l, t) Dim IE, HTA, sCmd, nRnd randomize : nRnd = Int(1000000 * rnd) sCmd = "mshta.exe ""javascript:{new " _ & "ActiveXObject(""InternetExplorer.Application"")" _ & ".PutProperty('" & nRnd & "',window);" _ & "window.resizeTo(" & w & "," & h & ");" _ & "window.moveTo(" & l & "," & t & ")}""" Set WshShell = WScript.CreateObject("WScript.Shell") with CreateObject("WScript.Shell") .Run sCmd, 1, False do until .AppActivate("javascript:{new ") : WSH.sleep 10 : loop end with 'WSHShell For Each IE In CreateObject("Shell.Application").windows If IsObject(IE.GetProperty(nRnd)) Then set HTABox = IE.GetProperty(nRnd) IE.Quit HTABox.document.title = "HTABox" HTABox.document.write _ "<HTA:Application contextMenu=no border=thin " _ & "minimizebutton=no maximizebutton=no sysmenu=no />" _ & "<body scroll=no style='background-color:" _ & sBgColor & ";font:normal 10pt Arial;" _ & "border-Style:inset;border-Width:3px'" _ & "onbeforeunload='vbscript:if not done.value then " _ & "window.event.cancelBubble=true:" _ & "window.event.returnValue=false:" _ & "done.value=true:end if'>" _ & "<input type=hidden id=done value=false>" _ & "<center><span id=msg> </span><br>" _ & "<input type=button id=btn1 value=' OK ' "_ & "onclick=done.value=true><center></body>" HTABox.btn1.focus Exit Function End If Next MsgBox "HTA window not found." wsh.quit End Function
×
×
  • 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.