Microsoft W2ksp4 En Exercice
I’m trying to instantiate IE in a WSC scriptlet using VBS 5.6 under W2K SP4 and IE 5.5. The following code works without a problem: Set oIE = CreateObject(“InternetExplorer.Application”) However, the following code results in a “80040111” WSH error (“Could not create object named scriptlet_name_here”): Set oIE = CreateObject(“InternetExplorer.Application”,”ie_”) Without being able to connect to the IE object, I don’t know how to trap closing the IE window after clicking on the close button, which would otherwise fire an IE_onquit subroutine. Can the IE CreateObject command contain two parameters in a WSC scriptlet? If not, how would one best detect a click on the close button? Regards, Andy — ********** Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com ********** Michael harris 2014-05-15 23:54:23. The 2nd argument of the VBScript form of CreateObject does not have the same purpose as the 2nd argument of the WScript form of CreateObject. Check the documentation for details Wrapping an IE instance in a WSC instance and sinking the IE events is difficult to do.
I know of only 2 ways: 1) use the element. The downside is that the IE instance is statically bound to the WSC instance. When the IE instance is closed, the WSC instance is effectively invalid for further use. 2) Use a 3rd party component like ScriptX which has (in its free no-license-required subset) a method that is roughly equivalent to the WScript.ConnectObject method). You could always assign an event handler to the window.onunload or onbeforeunload event using the GetRef() function. You’ll have to go via the IE.document.parentWindow to get the window object reference. Of course, this is *not* the same as the IE.OnQuit event because the unload events fire whenever the browser is navigated to an other page as well as when the browser is closed.
Try Microsoft Edge A fast and secure browser that's designed for Windows 10 No thanks Get started. Skip to main content. Microsoft Support.
— Michael Harris Microsoft.MVP.Scripting Microsoft Windows 2000 Scripting Guide TechNet Script Center Sample Scripts Download in HTML Help format (searchable) WSH 5.6 documentation download Andrew aronoff 2014-05-15 23:54:26. Thanks very much for your reply. Yes, I’d read the documentation and was aware that the 2nd argument in WSH connects the object’s output to the script while the 2nd argument in VBS is the location of a network server. However, nothing was said about how to perform the WSH function in VBS and I was sorta hoping that the documentation was, er, wrong. I like this idea. I tried it and despite endless permutations, couldn’t get a simple example to work. In the WSC file (or even in a VBS file), instead of working with “unload”, for illustration purposes, I chose “load”: Public oIE: Set oIE = CreateObject(“InternetExplorer.Application”) oIE.Navigate “about:blank” Do Until oIE.ReadyState = 4: Loop Set oDoc = oIE.Document oDoc.ParentWindow.OnLoad = GetRef(“WinSee”) oDoc.Body.AppendChild oDoc.CreateTextNode(“blah blah”) oDoc.ParentWindow.ResizeTo 200,100 oDoc.ParentWindow.MoveTo 500,50 oDoc.Body.Scroll = “no” With oIE.Toolbar = 0:.Statusbar = 0:.Resizable = 0:.Visible = 1 End With Sub WinSee MsgBox “see?” End Sub The MsgBox never appears.
Yes, I Googled and consulted the MSDN DHTML documentation, but couldn’t find the answer. Surely you’ll find my error in a blink. TIA and regards, Andy — ********** Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com ********** Michael harris 2014-05-15 23:54:30.
For one thing, an onload event is never fired *after* you hook the event because the page is never navigated to another page. But that’s really not the problem. When I said you *could* do this, I didn’t exactly say that it would *work*;-) I couldn’t get any onload/onbeforeunload/onunload event handled via the parentWindow. The best I could do was hook the handler to the oIE.document.body.onbeforeunload event. But if it is fired due to page navigation rather than closing, the hook is no longer effective since the document.body is destroyed by IE and replaced by a new one without the hook I suppose with enough experimentation and trail and error you might find a way if it’s *really* that important.
Might I ask if this is something other than an academic learning exercise? If this is intended as a solution to real problem, knowing what the real problem is would help. There might be an easier solution (at least I hope so).
— Michael Harris Microsoft.MVP.Scripting Microsoft Windows 2000 Scripting Guide TechNet Script Center Sample Scripts Download in HTML Help format (searchable) WSH 5.6 documentation download Andrew aronoff 2014-05-15 23:54:38. OK, OK, so it _wasn’t_ as easy as I thought. П˜‰ At least your response is now Google-able.
That’s a bit more complicated, IMVHO, than my current solution. I use an IE interface created by the WSC scriptlet to display status of another script launched on P2P LAN workstations to perform maintenance steps (such as registry save, defrag, chkdsk, antivirus scan, etc.) prior to a weekly tape backup. The IE window has a “Quit” button which is easy to trap. OTOH, if the user closes the IE window, it’s proven to be a bit tougher to trap. Right now, the value of.ReadyState is checked as follows: On Error Resume Next intIERS = oIE.ReadyState intErrNo = Err.Number On Error Goto 0 If intErrNo 0 Then [the window’s been closed] I was hoping I’d be able to get back to basics by trapping on IE_onQuit or, as you suggested, onunload, rather than.ReadyState. At the moment,.ReadyState appears to work correctly, but I don’t know (and haven’t researched) the pitfalls. Thanks for your help and regards, Andy — ********** Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com ********** Michael harris 2014-05-15 23:54:44.
General Dialogs Using Ie Take a look at the code to see how I dealt with exactly that issue. The zipped download includes a couple of demo scripts Don’t be too critical of how the wsc works internally. I wrote that in a few hours on a rainy spring Saturday mostly as a learning exercise. When I look at it now, it strikes me that there are now lots of different (and probably better) ways to do some of what I did way back then;-) — Michael Harris Microsoft.MVP.Scripting Andrew aronoff 2014-05-15 23:54:49. I’d seen references to it, and am studying it now.
Sure will, though when the Close button of the DemoMsgWscConsole.vbs window is clicked here and the “OK” button is pushed on the MsgBox, I see error 80010108 (“The object invoked has disconnected from its clients”), which is specifically the one I’m trying to avoid. I’m extremely grateful. Thanks to this thread, I’ll study an expert script. Thanks again for your help.
Regards, Andy “Michael Harris (MVP )” wrote: — ********** Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com ********** Michael harris 2014-05-15 23:54:58. I will readily admit that the demo scripts are *not* examples of robust, production quality, bullet-proof code. The primary purpose of the demo scripts was part illustration of basic usage and part documentation, not best coding practices! Be used in an infinite number of situations in an infinite number of ways, all with different client error handling requirements. However, msg.wsc *does* expose a closed property that will tell you if the wrapped IE instance has been closed, but the demo scripts don’t illustrate its use.
A robust client script would probably wrap any code that accesses the msg.wsc instance in local procedures that start with if msg.closed then exit sub function or has local on error resume next / goto 0 blocks to trap the potential error. Now, I *could* have done that internally in all of the public interface methods, and as I recall, I considered doing it. But what constitutes the “right thing to do” when an msg.wsc/ie related error occurs depends on whether or not the client script’s *functionality* is dependent on the IE instance staying open. Note that one thing I regret about msg.wsc is that I used an undocumented, non-wellformed xml syntax in the elements.
By that I mean that something like: is more properly written as: I should also note (now that I’ve looked at msg.wsc again and had time to think back 4 years), that I did try the syntax for the ie instance and it did not work. I had an email exchange about it with Andrew Clinick (who at the time was the Microsoft PM for all things related to scripting technologies). As it turned out, the underlying scrobj.dll implementation of the events attribute does not work with IE (and some other Office apps if I remember right).
In fact, the WScript.ConnectObject doesn’t work with IE either for the same reason. — Michael Harris Microsoft.MVP.Scripting Andrew aronoff 2014-05-24 16:49:01. I changed my WSC scriptlet from trapping oIE.ReadyState to trapping TypeName(oDoc) and TypeName(oIE) and learned a bunch of things along the way (all of which you well know). For instance, pushing a Quit button that references a subroutine that performs “oIE.Quit” does not affect the TypeName of the IE app or the underlying document. I find this odd.
(OTOH, closing the IE window via the Close button changes both the oIE and document TypeNames to “Object”.) My client checks for a Closed property before continuing but there are still cases where the WSC crashes due to its attempt to update a closed document. I added checks for the Closed property to the WSC, too, but it’s still haphazard — the debugger shows me that some of the time, I’ll happen to close the window just after the Closed property is checked and just prior to writing to the document. I’m not sure what to do about that other than improve my click timing. П˜‰ Perhaps you’ll have a suggestion. Msg.wsc is an admirable model script that I’ve consulted many times since I downloaded it. It’s where I go first to see how DHTML can be used in scripting.
What does one do to incorporate a Sleep method? Use a third party tool (like AutoItX)? Regards, Andy — ********** Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com ********** Torgeir bakken 2014-05-24 16:49:04.
'Joris' wrote in message news. >Hi, >>A W2KSP4 file server is filling up with people saving the same >document on several locations. To get a good overview I would like to >know if there is a way to list all double file names within a >directory. >>Can this be achieved by indexing or any other tool? >>Tia, >>J. Experience says that such an exercise will not achieve much, for these reasons: - People often select the same file name when storing different data, e.g. They have 'Expenses.xls' in different folders.
- When they save the file twice, they frequently neglect one copy later on. You would then see two files with the same name but with of different sizes and file dates. Which one can you delete? This translates into an extremely time-consuming task. It would be far more cost-effective to increase your storage space. If your growth figure is excessive then you should charge storage costs back to the user departments.
Quotas might help too. Pegasus (MVP) wrote: >'Joris' wrote in message >news. >>>Hi, >>>>A W2KSP4 file server is filling up with people saving the same >>document on several locations. To get a good overview I would like to >>know if there is a way to list all double file names within a >>directory. >>>>Can this be achieved by indexing or any other tool?
>>>>Tia, >>>>J. >>>Experience says that such an exercise will not achieve much, >for these reasons: >- People often select the same file name when storing different >data, e.g. They have 'Expenses.xls' in different folders. >- When they save the file twice, they frequently neglect one >copy later on. You would then see two files with the same >name but with of different sizes and file dates. Which one >can you delete? >>This translates into an extremely time-consuming task.
It >would be far more cost-effective to increase your storage >space. If your growth figure is excessive then you should >charge storage costs back to the user departments. Quotas >might help too. >Products to do the job are already be out there at places like Tucows and Download - and sure enough, a search for 'duplicate' in 'Windows' produces lots of hits at Tucows.
Those products search for duplicate files, not merely duplicate file names. Detecting duplicates is the easy part: its what to do with them when you find them that is the tricky part.
The technical part is very easy - select files and either simply delete them or replace them with shortcuts to a 'master copy'. What makes things difficult is making sure that you don't step on any toes when you find duplicate files and eliminate some or all of the extraneous copies. Example: in order to know that it is safe for you to delete all duplicates of a particular file you usually have to know what is in the file - and sometimes (often!) you will have absolutely no business viewing that file. When hard drives were expensive, I had to deal with this issue all the time. Example, HQ would send out a memo and every idiot would save his own copy of the memo - so I would search for duplicates of the memos I got (and hence that I had security clearance to read) and I would replaces users' copies with shortcuts to the master copy. 3cx 11 Crack Keygen Adobe Premiere there. However, now that hard drives cost about as much per GB than they did per MB back in those days, I wouldn't touch this issue with a ten foot pole.
It costs far more to deal with the duplicates in a manner that respects security issues than it does to simply buy more hard drives.
In the Talkback section to my post on, commenter Arm A. Geddon does something I’ve been meaning to do for a while, which is to rate the various versions of Windows through the years and try to decide which ones were hits and which were misses. You can read his comments for context. I’ve been writing about Windows pretty much full-time since the very early 1990s, so I have vivid memories of every version, some fond, some not so much.
This sort of exercise is fraught with intellectual land mines. For one thing, any opinion is going to be influenced by one’s personal preferences, experience, and technical competence. More importantly, any such rating has to be placed in historical context. Windows NT 4.0 was excellent in its day, but I can’t imagine trying to use it today to get any work done.
And finally, I’m going to factor in improvement over time, conceding that any initial release might have performance, stability, and compatibility issues but that the real test is how quickly and thoroughly those issues are dealt with. OK, with that out of the way All ratings are on a scale of 1 to 10, 10 being best. Windows 3.x: 8+ It was miraculous in its day. After years of using DOS and a variety of clunky task-switching programs like DesqView I was thrilled to have a GUI and a real memory manager. From a tinkerer’s point of view it was pure gold (Brian Livingston’s original Windows 3.1 Secrets was roughly 1200 pages.) Windows for Workgroups 3.11 introduced TCP/IP support, and even included a network card (I think I still have the little Microsoft-logo’ed screwdriver that came with it). With Norton Desktop for Windows or PC Tools, you could have a shell that foreshadowed the full-blown GUI of Windows 95.
Windows NT 3.x: 3 It’s difficult to read the system requirements for the first NT versions today and then remember how expensive memory upgrades were. At PC Computing, we had NT on a system or two in the labs.
Everyone thought it was cool and represented the future, but the lack of compatible software and hardware meant we couldn’t use it to get the job done day in and day out on the hardware we used. Windows 95: 5 The potential was awesome. It was 32 bits! (Well, sort of.) DOS was dead! (Uh, kinda.) The reality was frustrating. Living through the evolution of Plug and Play was no fun, and the perennial problem of 64K system resource heaps meant that it had to be rebooted way more often than it should have. Two service releases got rid of some problems, and a steady stream of 32–bit applications made for fun.
But if you ever had to install a network adapter or sound card you could kiss your weekend goodbye. Windows NT 4.0: 8 Ah, a solid kernel and the Windows 95 shell. This one was my preferred computing environment on the desktop from the day it was released in August 1996, exactly one year after the Windows 95 launch. Windows 98: 6+ This was what Windows 95 should have been, and the Second Edition was better still. NT was still a better choice for work, but I could use Windows 98 at home and install it on my Dad’s PC and be reasonably confident it would work.
Most 16–bit programs had ridden off into the sunset by this time (although there were noteworthy exceptions like, which was still available in 16– and 32–bit versions). Windows Me: 1 The worst Windows version ever, and doomed from the start. It was announced as the end of its line, it had to contend with Y2K fears, and it was buggier than a Fourth of July picnic on a Mississippi riverboat. The only feature that saved it from a zero is System Restore, which worked often enough to be useful if not dependable. Windows 2000: 9 For its time, it was nearly perfect, and when businesses had to upgrade their hardware or be pitched into Y2K hell, it was the ideal choice. Tons of application support and good solid drivers.
It’s no wonder some businesses still stick with it seven years later. Windows XP: 6/8 Why two ratings?
One for businesses, one for consumers. If you were running Windows 2000 already, you might have looked at the interface (“Fisher-Price” was the most common description) and said, “Huh?” But for consumers who were used to the crashes and mysterious lockups that were par for the course with the 16/32–bit hybrid 95/98/Me line, well it was a giant leap forward in stability and reliability. Windows XP Service Pack 2: 8+ As Jim Allchin, this could easily have been a separate Windows release instead of just a service pack. Microsoft really underestimated the security challenges that it would confront with Windows XP, and the improvements in SP2 really did make a difference. For businesses, it offers much better administrative tools and deployment options than Windows 2000. And after a few years the interface wasn’t so bad after all (and if you really hated it you could make it look just like Windows 2000). Windows Vista: 5/8 I was tempted to punt and put in a question mark, because this sort of rating won’t really be valid until two or three more years pass.
But in two years of beta-testing I think I’ve seen enough to make some preliminary judgments. The 5 is for businesses, the 8 is for enthusiasts. Vista is a solid platform with plenty of rough edges (UAC, anyone?) and its ecosystem needs another few months at least to catch up with it. At this point in its development its much like Windows 95 in its early days.
Businesses are wise to take their time. Digital media enthusiasts have a lot to love. And if Microsoft is smart they’ll release a feature-rich update – not just a service pack - every fall. OK, your turn.
Related Topics. By registering you become a member of the CBS Interactive family of sites and you have read and agree to the, and. You agree to receive updates, alerts and promotions from CBS and that CBS may share information about you with our marketing partners so that they may contact you by email or otherwise about their products or services. You will also receive a complimentary subscription to the ZDNet's Tech Update Today and ZDNet Announcement newsletters. You may unsubscribe from these newsletters at any time. ACCEPT & CLOSE.