Comatose 290 Taboo Programmer Team Colleague

Certainly, however there are some things to consider. If the program in discussion is run from a DOS prompt (meaning, it's a DOS based program, so, it shouldn't really have a "windows" window.), then you'll have to get creative. DOS Prompts, in my experience don't work well with sendkeys, so you would need to copy the data to the clipboard, and then send an "alt space ep" ("% ep", which is alt, space, e [for edit] and p [for paste]) to paste the data from the clipboard to the DOS prompt or DOS Based Program.

If you are working in a windows based program, for example, transfering data from excel to quicken or something crazy, you could absolutely create an instance of the excel object, load the spreadsheet of your choice, read in the data from the cells, and transfer that information to another windows based program no problem. Let me know if you need any further assistance in this matter.

Comatose 290 Taboo Programmer Team Colleague

While you are playing the game, hit cntrl-alt-delete, it will load task manager, but more importantly, will bring you back to windows While The Game Is Still Running!
Once Back in windows, click start, go to run, and type in cmd. You will get a black box window (a dos prompt), type in (at the black window) netstat. Take all the information it gives you, and either post it here, or e-mail me all that data. I'll sift through it, and find the server and port needed for this program.

Comatose 290 Taboo Programmer Team Colleague

It doesn't look like that's correct. I ran a port scan on the server: xaoswow.servegame.com, and that port doesn't show up as being open. At the same time, the web page shows a green box, meaning the server is up. Either you have the port wrong, or the server wrong.

Comatose 290 Taboo Programmer Team Colleague

The page is 8080, but I don't think the port for the game is.

Comatose 290 Taboo Programmer Team Colleague

I'll tell you what, you need to either A) Ask the Admin What PORT it runs on (or if you know what port it is, that's cool. You could always be connected to the game, go to a DOS prompt, and run NetStat, and give me the statistics of it.) Once I know the PORT and the Server IP, I'll build you one using Sockets, which will connect to the Game Port of the server, and not just to see if the box itself is up or down.

Comatose 290 Taboo Programmer Team Colleague

*Nods*

Comatose 290 Taboo Programmer Team Colleague

Mkay, And The Updated Version, Which is still not perfect and contains some minor flaws, but does exactly what you want. You may need to copy the tray.ocx to your windows\system32 folder, or just replace the one in the project with the one in the zipped folder... either way, the program works like a charm for me.

Comatose 290 Taboo Programmer Team Colleague

Wow, Cain, Thanks for that. However, The Forum is "Visual Basic" and to my knowledge (even with the use of wine on a wicked system) VB will NOT Run on a *nix box. I've tried. So, Should the thread be related to merely checking a server's status, that would be awesome, but this is a windows computer programming forum.

Comatose 290 Taboo Programmer Team Colleague

For Additional Fun, Add A Timer Control To Do This Every 10 Seconds

Comatose 290 Taboo Programmer Team Colleague

The easiest solution is to shell a ping command, and redirect the output to a temporary file. Open the Temporary file, and have your VB Program read in the lines (compare using instr) and check if there is a timeout, or if there is a response from the server. If there is a response from the server, naturally, the server is up. If you get, instead, a ping timout, then the server is down. If you really want to get fancy about it, you could try to connect the server on port 80 (the web page port), rip apart the HTML, and have it figure if the image is Red or Green. The first option is clearly easier, and is just as effective. Let me know if you need any further assistance in this.

Comatose 290 Taboo Programmer Team Colleague

The Zip is Invalid or corrupt... Please reattach the .zip in a new post to this thread. Thanks.

Comatose 290 Taboo Programmer Team Colleague

Oh Yeah, It's On!!!!

The Concept of how it works is this: The VB Program Makes A Batch File, Starts A Timer, And then runs the batch file. The timer searches for a specific file, every 100 MS... just exits the sub if it does not find it, but if it does find it, then the timer knows the batch file is done running (The last line of the batch file is to create this "flag" file). The Batch file Creates two files, the flag file (to signal the VB Timer control that the batch file has finished), and a results file. The results file is the output of a dir /a/s/b command, using redirection to create a new file with all it's output. Basically, the results file contains a list of paths to the extention in question. So, the vb app (when the timer sees the flag file) stops the timer, removes the flag file, removes the batch file, opens the results file for reading, loads the data into a listbox, and then deletes the results file. Whew! I've commented the code completely so you can see it line by line, but having a basic overview of what's going on helps a great deal.

Comatose 290 Taboo Programmer Team Colleague

Aw Crap! Here's Part of it:

in a Module (you'll also need to declare the registry API's, But There Are Too many API'S in my project to sift through):

Public Const REG_SZ = 1
Public Const REG_EXPAND_SZ = 2
Public Const REG_BINARY = 3
Public Const REG_DWORD = 4
Public Const REG_MULTI_SZ = 7
Public Const ERROR_MORE_DATA = 234
Public Const KEY_READ = &H20019
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_CONFIG = &H80000005
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_USERS = &H80000003

public Function EnumRegistryKeys(ByVal hKey As Long, ByVal KeyName As String) As Collection
    Dim Handle As Long
    Dim length As Long
    Dim index As Long
    Dim subkeyName As String
    
    ' initialize the result collection
    Set EnumRegistryKeys = New Collection
    
    ' Open the key, exit if not found
    If Len(KeyName) Then
        If RegOpenKeyEx(hKey, KeyName, 0, KEY_READ, Handle) Then Exit Function
        ' in all case the subsequent functions use hKey
        hKey = Handle
    End If
    
    Do
        ' this is the max length for a key name
        length = 260
        subkeyName = Space$(length)
        ' get the N-th key, exit the loop if not found
        If RegEnumKey(hKey, index, subkeyName, length) Then Exit Do
        
        ' add to the result collection
        subkeyName = Left$(subkeyName, InStr(subkeyName, vbNullChar) - 1)
        EnumRegistryKeys.Add subkeyName, subkeyName
        ' prepare to query for next key
        index = index + 1
    Loop
   
    ' Close the key, if it was actually opened
    If Handle Then RegCloseKey Handle
        
End Function

Public Function EnumRegistryValues(ByVal hKey As Long, …
Comatose 290 Taboo Programmer Team Colleague

If You Are Wanting To Retrieve A List of those options, for a given file, you are going to need to know a lot about the registry (a lot more than I can explain here). If you are already registry proficient, then, for a .doc file, for example, you might start by looking at: HKEY_CLASSES_ROOT\.doc, the "default" value for that, is a pointer, to another key in HKCR, in my case, Word.Document.8. So, you would then have to navigate to: HKEY_CLASSES_ROOT\Word.Document.8, and then check out the "shell" key. At this point, you'll have to "enumerate" all of the subkeys of the shell subkey, to give you a list of menu options. If you open one of the subkeys, you'll see that the tree nests even further, and if you open, say "New" you'll see a "command" subkey, which will reference the path and EXE to the file to launch in case of a click to "New".

Truth is, it's a real pain to do this, mostly because of the enumeration of the registry. This isn't the easiest thing in the world to do, but you would need the API Calls:
RegEnumKey, RegEnumKeyEx, and RegEnumValue (For The Values In The Keys). You Might Need RegOpenKeyEx, and RegCloseKey Too (Since I Think They Have To Be Opened Before You Can Enumerate Them). I Wrote A Program That Does This As A Part of it's functionality, but the Project in it's entirety isn't fully functional, So I won't be posting it. …

Comatose 290 Taboo Programmer Team Colleague

what do you mean by a list of possible actions? Something like the "open with" menu, or something like the properties menu?

Comatose 290 Taboo Programmer Team Colleague

No Problems, I know you'll help me when I need it! You could leave your code the same as what you posted above, only change the write #1 command to a print #1, and you'll remove the quotes :).

Comatose 290 Taboo Programmer Team Colleague

Alright...

Read Over This Code (It's Fully Commented) and you can pick out what you need, so that you can add it to your project and have it work the way you want it to. Right now, it (the wordnotepad) copies all the text in a word document (in this program, the path is the same as the running project [meaning the word document should be in the same folder], and it's name is test.doc), launches notepad, waits until it see's that notepad is loaded, and then sends it a paste command using Sendkeys.

This Method, however, is still not ideal. The reason, is because there are a lot of restrictions in place for it. You have to make sure that notepad is visible, and that it is the active (foreground) window. This also doesn't take into account any popup windows, or programs that might jump to the front of all the applications because of some event. Granted, (on my PC at least) once the VB app sees the notepad window, the sendkeys is almost immediate (before the form loads, in fact), but keep in mind that the possiblity for being interrupted and throwing the whole system out of whack does exist with the sendkeys method. Nevertheless, I have attached a project that shows how that can be done.

The Best Alternative That I have Found thus far, is to create a word instance, and use the "saveas" method to save the word document as a .txt …

Comatose 290 Taboo Programmer Team Colleague

Nice Code Here, But I would Personally Choose a different style. I think you have the right idea by using the word object, but I think you should use the methods of the word object to completely bypass the use of sendkeys (Well, At Least Put To A Minimum). For Example: http://www.dx21.com/SCRIPTING/VBSCRIPT/EXAMPLE.ASP, and then click the eye for "Spell Check Clipboard with Microsoft Word", it shows how to copy and paste information from Word Using The Word Object, However, That Wasn't Your Question, Just My Suggestion.

To Answer Your Question, I see two Major problems. One Is That Word Is Never Shown, or Set To Visible. This is a problem, because I'm pretty sure that sendkeys only works with active AND Visible Windows. The Second Issue, Is That VB Would be sending Keys (The File Open And All That) WITHOUT WAITING For Word To Be Launched. When You Instantiate A New Instance Of Word, It might take a variable amount of time (depending on the RAM and Processor Of The Machine in question). I suggest A couple of fun API Calls, One Is "FindWindow" (Or FindWindowEx If you want to be more daring), and "setforegroundwindow", however, you could also use AppActivate. In Order to get word to show (after creating the word object), you'll need to set it's .visible property (or invoke it's .show method, depends on the version you are using).

Sorry to be long winded, but I hope that some of the suggestions will …

Comatose 290 Taboo Programmer Team Colleague

You should be able to do a simple text like...

if form1.state = vbmaximized then
     ' /* Code For Maximized Form */
end if

However, vbmaximized MIGHT NOT be a constant, but numbers work, I believe 2 is maximized, but I could be mistaken. Also, The property might not be state, it might be style or something similar. So, Just test the property to find out if it's maximized or not.

As for adjusting the controls, you could do a loop of the control's collection, but you are going to be using a lot of comparisions to figure out the type of control you are working with. A Textbox doesn't have a caption property, for example, so you need to be aware of the differences involved with the properties of certain objects. I believe you can do a simple:

for each XCtrl in Controls
     msgbox XCtrl
next XCtrl

Then you could adjust them all with their properties in a simple for each loop. I hope this helps some.

Comatose 290 Taboo Programmer Team Colleague

in the form_resize event, you should be able to simple adjust the properties of the controls you want to mess with. For example, when the form gets resized (maximized) you can figure out the percentage and ratio, and use the .top, .left, .width and .height properties of any control:

command1.height = 5
command1.width = 10
command1.top = 0
command1.left = 0

For example..... let me know what you figure out.

Comatose 290 Taboo Programmer Team Colleague

Here is a fantastic tutorial covering the use of ADO with Visual Basic.... This should help quite a bit:
http://www.timesheetsmts.com/adotutorial.htm

Comatose 290 Taboo Programmer Team Colleague

I'm not a C guy by any means, but I think you can cast it.... such as:

newvar = (int)x + (int)y;

Someone who Codes a lot of C, please check this over...

Comatose 290 Taboo Programmer Team Colleague

No No, Not at all. The only stupid question is the one you don't ask. I just thought it would be fun to be a Shaolin of VB :D

Anyway, here is a good page to read up about sendkeys... there used to be a lot more, this one took some digging. I suppose I'll have to write one for Daniweb... Anyhow, you use it just by calling it, but it needs keys to send:

sendkeys "hi"

The Problem is, That It has codes that can go with it. For Example:

sendkeys "~{F4}{ENTER}"

Is The Same As Pressing Alt-F4, And Then Enter, at the same time. Alt F4 closes the currently active App, and Enter would be pointless.... but for an example for you to see, I put it there like that. I'm guessing you would do something like:

sendkeys ":){ENTER}"

Either way, Here is a page that lists the special characters, and the stuff you can put in braces:
http://www.scriptlogic.com/Kixtart/htmlhelp/Functions/sendkeys.htm

Let me know how it turns out.

Comatose 290 Taboo Programmer Team Colleague

*Sits Here Like an Old Wise Shaolin VB Monk*

Use..... Sendkeys.

Comatose 290 Taboo Programmer Team Colleague

Cool, I know why it does what it does, and it's because it only responds to user initiated events (getinputstate), It just makes it so that the user can interact with it... I wasn't sure if the speed increase was significant enough to warrant your use of it.... I don't personally use it, unless the application does an extreme amount of processing or calculations. I stick with the standard doevents... thanx for letting me know how it worked (or didn't in this case). :)

Comatose 290 Taboo Programmer Team Colleague

We Can Fix That Also, By using a quick API call, and only calling doevents if there is information waiting in the message queue for our app (since I can see you're concerned with speed ;)) In your declarations section of your form, OR in a standard code module, add this (assuming code module):

Public Declare Function GetInputState Lib "user32" () As Long

Then Just Replace the Lonely DoEvents With This Code:

If GetInputState <> 0 Then DoEvents

Let me know the speed difference if you would please :)

Comatose 290 Taboo Programmer Team Colleague

I think Visal certainly hit the nail on the head with that one. Doevents is the way to go. Do me one big favor, and let me know how it turns out.

Comatose 290 Taboo Programmer Team Colleague

do you have a sub or function with the name of xLoadList? If so, please post the code for that as well. If NOT, then the problem is you have an X before loadList ;)

Comatose 290 Taboo Programmer Team Colleague

;), and uh, the ten character post limit!

Comatose 290 Taboo Programmer Team Colleague

What method exactly are using to write to the file? You have posted no code, but I'm guessing that you are using "write" to write the information to the file. Change your write command to print. print #1, "your data" should work fine. Here is the code example that I just built to test this theory, (which was successful):

Private Sub Form_Load()
Open "c:\output.txt" For Output As #1
    Write #1, "write test"
    Print #1, "print test"
Close #1

For Each XFrm In Forms
    Unload XFrm
Next XFrm
End Sub

This works great on my box. I'm pretty sure that this idea spans as far back as QBasic, but I'm not sure if it goes on through .NET (since I don't use .NET). Let me know if this helps to solve your problem.

Comatose 290 Taboo Programmer Team Colleague

Ah! Very good catch. Let me know how the project turns out, or if the methods that I suggested above worked... It'll be fancy to hear what happens. Also, If you encounter any other problems with it, don't hesitate to ask.

Comatose 290 Taboo Programmer Team Colleague

looked at TTPScan and gets error loading cswsk32.ocx on loading into vb.

You don't need it.... it uses winsock because it's on everyone's computer, the other is there just for the ping sweeper, and it's not needed for the port scanner.

I'll be willing to bet, the error that you are recieving however, is because the socket is still connected. With winsock, you have to use .state (socketwrench has a .connected property) to test if the socket is connected before trying to reconnect. So, you do a loop with a doevents in the middle, and wait for the socket's state to become closed. Another thing to take into consideration, is maybe instead of a for loop, try using a variable that keeps track of which server you are scanning, and when the list of scanned ports completes, if it's the last port to scan for that IP, on the socket's error or connect event, call a socket close (disconnect), and start on the next IP.
The problem with the for loop, is that it doesn't wait. It loops each iteration until it's done, and the only way to get it to stop is to break out of it or use a sleep. The sleep will pause your entire app though, not just the loop. So, we need to look at working with event driven looping. On Error, On Connect, On Close, etc. The socket is a control array, so it's not that difficult to check if we are …

Comatose 290 Taboo Programmer Team Colleague

I don't use winsock. It's functionality is limited in the realm of sockets, and to make matters worse, I find the code you need to work with it... well, leaves a lot to be desired. I prefer the use of a control that is free from http://www.catalyst.com, known as socketwrench. It makes working with sockets 100 times easier, and it gives a whole list of properties and methods that make winsock look like a joke. Anyhow, I have written a port-scanner in VB6, and you can download the source from this thread:
http://www.daniweb.com/techtalkforums/thread18197.html

Let me know if this helps! If you really MUST use winsock, maybe the concept behind how my port scanner runs will help give you the same idea to use with your winsock app.

Comatose 290 Taboo Programmer Team Colleague

The unfortunate answer is that VB ultimately only allows you to assign arrays as such. However, There is a minor solution that you can take into play. Depending on the data type, you can use different predefined functions in VB to return yourself arrays, but it's kind of crappy. There is a function, in VB4-6, Called "Array", but it will only assign variant data types, and to be perfectly honest with you, variant data types suck. They are huge, bulky, and make your program slower than needs be. They are really ugly variable, and should be avoided. You can use the function like this, however:

Dim theArray() As Variant
theArray() = Array("Spring", "Summer", "Fall", "Winter")

If The Data Type Were Strings, You could get fancy, and use the split function, but it's not really the same concept as you were wanting:

dim strArray as string
strArray = split("summer;winter;spring;fall", ";")

Or You can create a function to handle this, which is probably the best means of doing so. It's a bit of a pain, compared to a language like Perl, or Delphi, where assigning values is fairly easy.

Function ArrayInt(ParamArray values() As Variant) As Integer()
    Dim i As Long
    ReDim res(0 To UBound(values)) As Integer
    For i = 0 To UBound(values)
        res(i) = values(i)
    Next
    ArrayInt = res()
End Function

Let me know how this code works for you, and if you need any further assistance. I'll be glad to help.

The information referenced here, was taken …

Comatose 290 Taboo Programmer Team Colleague

I certainly appreciate you posting the working code and solution. This way others have the ability to learn from what we had just struggled with. Good Job, and Congrats :)

Comatose 290 Taboo Programmer Team Colleague

I just double click on the icon and it runs. I'm guessing perhaps your version of windows doesn't have the latest IE installed, or the latest WSH installed, if at all (thought it should). That said, try it the first way:

TheDay = ReturnDay()

if Theday = "Wednesday" then
     shell ("C:\progra~1\intern~1\iexplore.exe file://G:\CIHStaffNews.htm")
else

end if

WScript.Quit

public function ReturnDay
	RawDate = FormatDateTime(Now(), 1)
	Parts = split(RawDate, ",")
	ReturnDay = Parts(0)
end function
Comatose 290 Taboo Programmer Team Colleague
dim oIE
Set oIE = WScript.CreateObject("InternetExplorer.Application")



TheDay = ReturnDay()


if Theday = "Wednesday" then
	oIE.Navigate "www.google.com"
	oIE.Visible = True
else

end if
set oIE = Nothing
WScript.Quit

public function ReturnDay
	RawDate = FormatDateTime(Now(), 1)
	Parts = split(RawDate, ",")
	ReturnDay = Parts(0)
end function

This works perfectly fine on my machine. It spawns IE and loads google with no problem. Try to copy and paste the code I have posted here, into a document, and see if it works.

Comatose 290 Taboo Programmer Team Colleague

I'm willing to bet that the 1 to 3 minute loading process is due to the exchange of information on the back end. I'm not blaming Oracle, I'm blaming VB in the way that it works with Large amount of information. As for the speed in loading your combo box, you could consider using the API. You could use SendMessage, and there are a lot of windows messages for working with combobox's with the API. You would Need CB_ADDSTRING, in conjunction with Sendmessage. However, the speed increase would only be in transfering the data to the combobox, NOT in your application recieving the data and firing events to let you know it's there. Also, the speed increase may not be significant enough for you to alter your code for it's use.

The bad news, is that with that many records, the query process, along with other types of data retrieval and use, quite simply will take a long time. I wish the best of luck to you in your attempts to resolve this issue, and please, should you find a method of speeding up the process, post it so that we know how you did it.

Comatose 290 Taboo Programmer Team Colleague

Have you tried replacing file://G:\CIHStaffNews.htm with an actual URL? Such as google or yahoo, to see if it actually loads a web page? After changing .show to .visible did the IE window actually show up, and now you are getting a different error?

Comatose 290 Taboo Programmer Team Colleague

Oops. Just replace:

oIE.Show

with:

oIE.Visible = True
Comatose 290 Taboo Programmer Team Colleague

Yes, I'm pretty sure that IE has no idea what that share is. If it was assigned a drive letter, that might be a different story... but because it's not, I'm willing to bet that IE has no clue what it's looking at. If you could assign the share a drive letter, it should probably work.

Comatose 290 Taboo Programmer Team Colleague

And For Access Groups, it looks like you have it pretty well in play, but here is a link to a site that has a function and sample code for working with ADS with VBScript.
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/usersgroups/groups/#DetermPrimGroup.htm

Comatose 290 Taboo Programmer Team Colleague

"file://cih_data\IT\Public\CIHStaffNews.htm"

You Have a mapped drive called cih_data?

dim oIE
Set oIE = WScript.CreateObject("InternetExplorer.Application")

TheDay = ReturnDay()


if Theday = "Tuesday" then
	oIE.Navigate "file://cih_data\IT\Public\CIHStaffNews.htm"
	oIE.Show
	set oIE = nothing
else

end if

WScript.Quit


public function ReturnDay
	RawDate = FormatDateTime(Now(), 1)
	Parts = split(RawDate, ",")
	ReturnDay = Parts(0)
end function
Comatose 290 Taboo Programmer Team Colleague

I'm not 100% sure what an AD Group is.... if you can give me a little more light on that subject, I can probably help you out. As for retrieving the Day of the Week (say, Sunday - Saturday), I have written a function that returns the day of the week from the current day. Here is that function, just stick it at the very very bottom of your script (like, after wscript.quit):

public function ReturnDay
	RawDate = FormatDateTime(Now(), 1)
	Parts = split(RawDate, ",")
	ReturnDay = Parts(0)
end function

And you can call that function like this:

TheDay = ReturnDay()

You would probably use it like so:

TheDay = ReturnDay()

if Theday = "Friday" then
     ' /* Do Stuff Here For Friday */
else
    ' /* Do Stuff Here For Every Other Day */
end if

If you can get me a little more info on "AD", I'll see what I can do about retrieving the Group that the user belongs to.

Comatose 290 Taboo Programmer Team Colleague
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\PATH2XLS\whatever.xls")
objExcel.Visible = true

Now, you can change between those little tabs at the bottom (sheets) by using:

objExcel.ActiveWorkbook.Sheets(1).Select()

and whatever you do, DO NOT forget to:

set objExcel = nothing
Comatose 290 Taboo Programmer Team Colleague

You should only need to install the most recent ones. Hang in there with programming in VB, and keep pushing yourself to learn more. Don't feel restricted to VB though... once you get a grip on it, and feel comfortable building apps, move on to something else, like C or Perl. Let me know if my method for loading the word doc works. :)

Comatose 290 Taboo Programmer Team Colleague

They are whole bunch ocx and dll files that VB uses behind the scenes in order to make the application work. A Few of things include some of the tools that you might use, (some control's) and so forth. Microsoft has or had an EXE that automatically installed the VB runtime files (a cute little setup program), and it was easily downloadable. You could distribute it with your application if you wanted to run a "setup" program, that you had built in VB.

Also, it's a lot easier to use VBS with word. If you know the path to word, you can use shell, but this is much easier:

Dim Word
Set Word = CreateObject("Word.Application")
Set doc = Word.Documents.Add("c:\path2worddoc\somedocument.doc")
Word.Visible = True

That will create a word object, it will add the document of your choice (Given by path in the add method), and then make the word window visible. However, before you make your project close, make certain that you set the references to word and to doc to nothing.... otherwise it will stay loaded, even after your close the document, word and your app. Bad Bad Code. So, in form unload:

set word = nothing
set doc = nothing

That should unload word's process when it's closed. If you really want to use shell, you can, but you have to know the path to word's EXE file, and then you have to pass it the path of the file you want to load. For example, …

Comatose 290 Taboo Programmer Team Colleague

Good Solution. I also appreciate you posting your solution to the site, so that others with similar problems have a chance to fix the same issue. Thanx.

Comatose 290 Taboo Programmer Team Colleague

The only real way to find out, is to have the VB IDE running the program when it crashes, so that the debugger can highlight the problem line. I'm guessing that you are compiling it to an EXE and then running it on the client machine. It may be a paperbin problem if the system doesn't have it on the client machine. You SHOULD be able to test for how many bins there are and if there is only one, just don't mess with it.... let me know what you come up with.

Comatose 290 Taboo Programmer Team Colleague

0, makes it hide the window, so that it doesn't show up to the user (otherwise, they'd get some stupid dos window).
1, makes the Run Method of the WSH Object wait until the spawning process completes, before continuing on.