Jump to content

Recommended Posts

Posted

I looked for answers on how to suppress the Found New Hardware Wizard dialog, but found little that worked. So I wrote a little VBS script that uses the taskkill command to kill windows where windowtitle eq Found New Hardware Wizard. I found this approach to be preferable to all the others tried to this point.

So I wanted to post it for what its worth. If you have a new hardware wizard giving you grief and new to kill it, this may be what you seek.

The script is written to take two inputs, one mandatory and one optional. The mandatory input is for a timeout value (e.g., /TimeOut:20). In other words, the amount of time, in seconds, the thing will run. The second input, the /Name:[yourtexthere], is optional and can be used to help you track when you dispatched this script. This info is written into the WizKilla.vbs log file. For example, lets say when installing the WLAN driver the Found New Hardware Wizard is giving you grief. Simply dispatch the WizKilla.vbs immediately before launching your unattended driver install. Use the following syntax:

cscript.exe //nologo wizkilla.vbs /Timeout:20 /Name:WLAN

---- Begin WizKilla.vbs -----

'-----------------------------------------------------------------------------

' This script Loops a set number of times based on user supplied input value

' Where each loop is eqaul to 1 second in duration.

' During each loop a taskkill command is executed to kill the window(s)

' titled 'Found New Hardware Wizard'

'

' Date: 08.21.06

' Author: Bruce Inciardi

' Revision: original

'-----------------------------------------------------------------------------

strComputer = "."

Const ForAppending = 8

Set oArgs = wscript.Arguments

Set colNamedArguments = WScript.Arguments.Named

strName = colNamedArguments.Item("Name")

strTimeout = colNamedArguments.Item("Timeout")

Set WshNetwork = WScript.CreateObject("WScript.Network")

Set WshShell = WScript.CreateObject("WScript.Shell")

compname = WshNetwork.ComputerName

set FSO = CreateObject("Scripting.FileSystemObject")

strLogFile = "\LOGS\" & Split(WScript.ScriptName, ".")(0) & ".log"

pathtologfile = WshShell.ExpandEnvironmentStrings _

("%SystemRoot%" & strlogfile)

If FSO.FileExists(PathToLogFile) Then

'' Wscript.Echo "File exist."

Set objLogFile = FSO.OpenTextFile(pathtologfile, ForAppending)

Else

'' Wscript.Echo "File does not exist."

Set objLogFile = FSO.CreateTextFile(pathtologfile, TRUE)

End If

objLogFile.WriteLine(Now & ": " & WScript.ScriptFullName & " Started." & vbCrLf)

objLogFile.WriteLine("Current Computer Name: " & compname)

objLogFile.WriteLine("Log File/Path: " & pathtologfile)

objLogFile.WriteLine("Script loops 'x' times based on user provided input and kills 'New Hardware Found Wizard' dialogs." & vbCrLf)

If Not colNamedArguments.Exists("TimeOut") Then

objLogFile.WriteLine("Input in error")

objLogFile.WriteLine("Correct Usage:")

objLogFile.WriteLine("cscript WizKilla.vbs /TimeOut:10 /Name:" & Chr(34) & "Intel WLAN" & Chr(34))

Wscript.quit(0)

End If

iTimeout = strTimeout

iTimeout=CInt(strTimeout)

objLogFile.WriteLine("Launched with parms: /Timeout:" & strTimeout & " /Name:" & strName & vbCrLf)

Wscript.Echo "Shhhh, be vewy qwiet..."

Wscript.Echo "...I'm hunting Found New Hardware Wizard Dialogs."

iLoop = 0

Do Until iLoop > iTimeout

iLoop=iLoop+1

WScript.Sleep 1000

If iLoop > iTimeout Then

Exit Do

Else

' "Perform taskkill cmd here"

killacmd = "taskkill /FI " & Chr(34) & "WINDOWTITLE eq Found New Hardware Wizard" & Chr(34)

Set oExecObject = WshShell.Exec("%comspec% /c " & killacmd)

Do Until oExecObject.StdOut.AtEndOfStream

strLine = oExecObject.StdOut.ReadLine()

if (Instr(strLine,"INFO:")<>0) Or (Instr(strLine,"SUCCESS:")<>0) Then

If Instr(strLine,"SUCCESS:")<>0 Then Wscript.Echo "Got One!"

objLogFile.WriteLine(Now & ": (" & iLoop & ") " & strLine)

End If

Loop

End If

Loop

objLogFile.WriteLine("Script Completed; Timeoutvalue reached" & vbCrLf)

objLogFile.WriteLine(Now & ":" & vbTab & WScript.ScriptFullName & " Ended." & vbCrLf)

---- End WizKilla.vbs -----

Hope this helps someone.

Bruce

  • 2 months later...

Posted

Just come across this, it turns out that it thinks usbstor.sys is unsigned -the one I had mismatched the one listed in usbstor.inf - just copied them from a good setup dir

  • 2 years later...
Posted

I have a problem with the New Hardware Wizard, and read through this, but was not able to find the file in regedit that I need to get to.

When I get into [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows there is no folder for "DriverSearching" at all. The only Folders I see are:

Installer

IPSec

Safer

System

WiredL2

Similarly, when I go into [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows NT the only folder I see is

"Terminal Services"

There is no "DriverSigning" present

The problem I am getting is that everytime I boot my computer the Found New Hardware Wizard comes up, and when I try to run it, it just gets stuck. I end up cancelling it, but would prefer that I not need to do this anymore.

Could anyone tell me if these missing folders have something to do with the Wizard malfunctioning?

Thanks!

  • 2 weeks later...
Posted

You can create the new key and add some data.

REG ADD HKLM\SOFTWARE\Policies\Microsoft\Windows\DriverSearching /v DontSearchWindowsUpdate /t REG_DWORD /d 1 /f
REG ADD HKLM\SOFTWARE\Policies\Microsoft\Windows\DriverSearching /v DontPromptForWindowsUpdate /t REG_DWORD /d 1 /f
REG ADD HKLM\SOFTWARE\Policies\Microsoft\Windows\DriverSearching /v DontSearchCD /t REG_DWORD /d 1 /f
REG ADD HKLM\SOFTWARE\Policies\Microsoft\Windows\DriverSearching /v DontSearchFloppies /t REG_DWORD /d 1 /f

  • 7 months later...
Posted (edited)

i'm having this situation as explained here:

http://www.msfn.org/board/new-hardware-wiz...pid-888585.html

and here: http://www.msfn.org/board/stop-found-new-h...pid-884196.html

all i need is to kill the window: found new hardware wizard..

ok.. my cuestion is how can i implement a VB script or auto it compiled exe to kill this windows that appears 3 times at T-25 of unattended SP3 pro install if a click cancel 3 times the windows dissapear and installation keep going normally.. sometimes i have to click Alt+ tab for the windows to show up because it looks like they remain in the background of the installation preventing to continue.

all i can find is comments about implementing auto it to install programs.. that's not what i need.. many people say do this this...etc just ideas but don't explain exactly what to do..

i found searching this script for auto it that's is supposed to kill the window also... bug i guess it missing some command to wait for 25 minutes then look for the window 3 or 4 times to kill it..

here it's:

this is AutoIT3 script that I use to get rid of those "New Hardware

Found" windows.

Save it as e.g. close_popup.au3, download autoit and compile to exe.

It will run in the background waiting for specified windows and

closing them. You can stop it by using /QUIT.

Just change 'Found New Hardware Wizard' to the title of your window,

and 'Welcome' to any text of the popup.

You can change the name of the script window ('KillHWiz') but it's not

neccessary.

There is also a auto it dll that you can use through Win32API or ruby/dl.

HTH,

J.

----8<--------------------

If $CmdLine[0] = 1 and $CmdLine[1] = '/QUIT' Then

WinClose('KillHWiz')

Else

AutoItWinSetTitle('KillHWiz')

While 1=1

WinWait ( 'Found New Hardware Wizard', 'Welcome' )

WinClose ( 'Found New Hardware Wizard', 'Welcome' )

WEnd

Source: http://www.mombu.com/programming/ruby/t-do...es-1308554.html

please any inputs are welcome.

My Best Regards

Edited by CRK
  • 1 month later...
Posted

On WinXP, then the 'Found new hardware' wizard will still be shown even though there are a driver available if the driver is either unsigned, or is only a compatible ID match and not a direct hardware ID match, so the wizard is shown for prompting if the end-user has a better driver available than this...

  • 6 years later...
Posted (edited)

Thanks to CRK suggestion I made a better AutoIt3 script https://www.autoitscript.com/site/autoit/downloads/ which would continue with all New Hardware Wizard windows accepting non signed drivers, Cancelling WinXP CD prompts and skipping multiple options (connect to internet, etc), so as to get Mouse and Keyboard detected and installed. The compiled autoit script EXE should be copied to the "Start" (within "Start Menu") folder to be automatically executed. The script strings MUST be adapted to the local windows language. And probably some Alt-LETTER combinations too. My sample works in SPANISH WinXP. Hope it helps somebody else, after having mouse and keyboard functioning, script must be deleted (or moved to other folder):

$asistente= "Asistente para hardware nuevo encontrado" ;"Found New Hardware Wizard"
$instalacion= "Instalación de hardware"
$archivos= "Archivos necesarios"
$cambio= "Cambio de configuración del sistema"

while 1
sleep(200)

if WinExists( $cambio) then
   WinActivate( $cambio)
   sleep(200)
   Send("!n")        ; (press Alt-n)
endif

if WinExists( $instalacion) then
   WinActivate( $instalacion)
   sleep(200)
   $text=WinGetText( $instalacion)
   if StringInStr( $text, "El software que está instalando para este hardware") then ;"The software..."
     Send("!c")
    endIf
;  MsgBox($MB_OK, "Autoit Status", $text & stringinstr( $text, "está"), 2 )  ;  sleep(2000)
endif

if WinExists($archivos) then
   WinActivate($archivos)
   sleep(200)
   $text=WinGetText( $archivos)
   if StringInStr( $text, "Se necesita el archivo") then
       ControlClick( "Archivos necesarios", "", "[ID:2]" )
    endIf
endif

if WinExists( $asistente) then
   WinActivate( $asistente)
   sleep( 200)
   $text=WinGetText( $asistente)

   if StringInStr( $text, "Desea que Windows se conecte a Windows Update") then ;"Can Windows connect to Windows Update to search for software?"
;     ControlCommand( $asistente, "", "[ID:8104]", "Check", "")
     sleep(150)
;     ControlClick( $asistente, "", "[ID:12324]")
     Send("!n")
     sleep(100)
     Send("!t")
     sleep(250)
   endif

   $text=WinGetText( $asistente)
   if StringInStr( $text, "Este asistente le ayudará a instalar software para:") then ;"This wizard"
     sleep(150)
     Send("!t")
     sleep(250)
   endif

   $text=WinGetText( $asistente)
   if StringInStr( $text, "No se puede instalar este hardware") then ;"Cannot Install this Hardware"
     ControlCommand( $asistente, "", "[ID:1030]", "UnCheck", "")
     sleep(200)
     ;ControlClick( $asistente, "", "[ID:12325]")
      Send("{ENTER}")
     sleep(200)
   endif

   $text=WinGetText( $asistente)
   if StringInStr( $text, "desea que haga el asistente?") then ;"What do you want the wizard to do?"
   ControlCommand( $asistente, "", "[ID:1049]", "Check", "")
   sleep(200)
   ControlClick( $asistente, "", "[ID:12324]")
   sleep(200)
   endif

   $text=WinGetText( $asistente)
   if StringInStr( $text, "Se recomienda que se conecte a Internet para que el asistente") then
   ControlCommand( $asistente, "", "[ID:1065]", "Check", "")
   sleep(200)
   ControlClick( $asistente, "", "[ID:12324]")
   sleep(200)
   endif

   $text=WinGetText( $asistente)
   if StringInStr( $text, "Finalizar para cerrar") then ;"Click Finish to close the wizard."
   ControlClick( $asistente, "", "[ID:12325]")
   sleep(250)
   endif
endif

wend

Edited by isidro

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...