Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing active programs 1

Status
Not open for further replies.

DeeBeeGee

Programmer
Sep 28, 2004
21
0
0
GB
How can I clear a (externally created) message box ?
Currently I am using sendkeys[enter] but this is very hit and miss. The message box is created when a windows scripting file is succesfully registered - a process I call using WshShell within VBA. Is there a way to refer to this box. It does appear on my windows taskbar.
 
If you are running regsvr32.exe to register the file, then running it with a /s flag will cause it to not pop the message in the first place.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
sounds exactly what i am after! but where do i put the flag?

my relevant line of code is

WshShell.Run ("REGSVR32 /u /n /i:" & Chr(34) & "T:\Acgscripts\wsc\userinfo.wsc" & Chr(34) & Chr(32) & Chr(34) & "C:\WINNT\System32\scrobj.dll")

 
Actually you can scrap that as I was being dim. Thanks for the help. It works perfectly
 
Actually TomThumb I was duped!!
The code was running through without error but not registering the file.
I have tried
WshShell.Run ("REGSVR32 /u /n /s:" & Chr(34) & "T:\Acgscripts\wsc\userinfo.wsc" & Chr(34) & Chr(32) & Chr(34) & "C:\WINNT\System32\scrobj.dll")
and
WshShell.Run ("REGSVR32 /u /n /i /s:" & Chr(34) & "T:\Acgscripts\wsc\userinfo.wsc" & Chr(34) & Chr(32) & Chr(34) & "C:\WINNT\System32\scrobj.dll")
both to no avail but my original command which produced the msgboxs still works fine
 
Here is what I would try:
WshShell.Run Chr(34) & "REGSVR32 " & Chr(34) & "/u /n /s" & Chr(34) & " T:\Acgscripts\wsc\userinfo.wsc" & Chr(34) & Chr(32) & Chr(34) & "C:\WINNT\System32\scrobj.dll"

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
It didnt like that at all. What would be the correct command as typed in ms-dos
ie. without all the Chr(34)s confusing everything
 
Are you trying to register a .wsc and dll in one call?


[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Nevermind, I assume you are attempting to register a wsc through scrobj.dll. First, this is only necessary for older versions of regsvr32. First try this:

regsvr32 T:\Acgscripts\wsc\userinfo.wsc

If that does not work then you will need to use scrobj.dll like this:

regsvr32 scrobj.dll /n /i:T:\Acgscripts\wsc\userinfo.wsc

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
I think I am trying to use the dll to register the wsc (It may be that my understanding is off piste). However, I do know that the line
REGSVR32 /i:"T:\Acgscripts\wsc\corporateheader.wsc" "C:\WINNT\System32\scrobj.dll"
works but produces the pesky msgbox.
I was hoping that it might be as simple as changing the this command slightly we could suppress it??
 
I am using Windows NT so the first method failed and the second succeeded although still with the msgbox I am trying to eliminate. Where should I put the "/s" flag?

ps. I hope you're not hoping you'd never answered my first query :)
 
Try:

regsvr32 /s scrobj.dll /n /i:T:\Acgscripts\wsc\userinfo.wsc

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Aha!

regsvr32 scrobj.dll /n /s /i:T:\Acgscripts\wsc\userinfo.wsc

works. And I definitely mean it this time. I've tested it and everything!!!

Thankyou ever so much for all your help. A star for you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top