Hi fella's!

I'm having a really hard time porting a VBScript I put together to VisualBasic...
The Script/Program will run from a directory on a CD, in the same directory there will be an updated SWF file to an existing
program I have created in Flash... I need the VB program to be generic, thats why all the variables are present...

This is a rundown of the operation...

Open file located in the same directory as AutoUpdater, store filename as a variable named swfName...
swfExist = swfName
Search local HDD's for swfExist...
If existing swfExist does not exist, End with Message "Original file not installed!", Quit...
If existing swfExist Exists, store absoulte path of swfExist in variable swfPath...
rename swfPath/swfExist.swf to swfPath/swfExist.bak...
copy swfName to swfPath...
End Program


The VBScript works pretty damn well, but now I want to convert it into an Exe and add a form page to make it all look nice...



VB Code:
  1. Dim swfDir
  2. Dim swfName
  3. msgbox"   This program will automatically update vital program files." & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "At the next screen, please select the Updated SWF file!",0,"SWF Updater"
  4. Set ObjFSO = CreateObject("UserAccounts.CommonDialog")
  5. ObjFSO.Filter = "SWF Files|*.swf"
  6. ObjFSO.FilterIndex = 1
  7. ObjFSO.InitialDir = ".\"
  8. InitFSO = ObjFSO.ShowOpen
  9. If InitFSO = False Then
  10.     Wscript.Echo "You didn't select a file!!!"
  11.     Wscript.Quit
  12. Else
  13.     msgbox"We will now begin a search for the original file..." & Chr(13) & Chr(10) &  Chr(13) & Chr(10) & "This may take a few moments... Please Wait!" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "If you recieve a McAfee warning, Select..." & Chr(13) & Chr(10) & "'Allow entire script this time'" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "...To continue with the program!",0,"Ready To Search!"
  14.     FileNameArray=Split(ObjFSO.FileName,"\")
  15.     swfName = FileNameArray(UBound(FileNameArray))
  16. End If
  17. 'Search Function
  18. sCmd = "cmd /c dir c:" & swfName & "/s /b "
  19. Set shell = createobject("wscript.shell")
  20. Set d = CreateObject("Scripting.Dictionary")
  21. Set wsx = shell.exec(sCmd)
  22. Set wsxOut = wsx.stdout
  23. Do: wscript.sleep 10
  24.   Do until wsxOut.atendofstream
  25.     d(d.count) = wsxOut.readline
  26.   Loop
  27. Loop until wsx.status <> 0 And wsxOut.atendofstream
  28. For Each filepath in d.items()
  29.    msgbox"swffile found in: " & Chr(13) & Chr(10) & Chr(13) & Chr(10) & filepath & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "We will now apply the Updated SWF!!!",0,"File Found!!!"
  30.   swfDir = filepath
  31. Set swfExe = CreateObject("Scripting.FileSystemObject")
  32. If swfExe.FileExists(filepath & "BACKUP") Then
  33.  
  34.     Wscript.Echo "The updated SWF appears to already be installed!!!" & Chr(13) & Chr(10) &  Chr(13) & Chr(10) & "No files were modified!!!"
  35.     Wscript.Quit
  36. Else
  37. Set RenameObject = CreateObject("Scripting.FileSystemObject")
  38. RenameObject.MoveFile filepath , filepath & "BACKUP"
  39. msgbox"Your original file has been backed up...",0,"Important!"
  40. 'Copy Function
  41. Set FileObject = CreateObject("Scripting.FileSystemObject")
  42. FileObject.CopyFile ObjFSO.FileName, swfDir
  43. End If
  44. Next
  45. Set origExe = CreateObject("Scripting.FileSystemObject")
  46. If origExe.FileExists(swfDir) Then
  47. msgbox"All Done!!! " & Chr(13) & Chr(10) &  Chr(13) & Chr(10) & "You can now play the swf without the CD in the drawer!!!" & Chr(13) & Chr(10) &  Chr(13) & Chr(10) & "[email protected]",0,"All Done!"
  48. Else
  49. msgbox"You don't appear to have Kryopit installed!" & Chr(13) & Chr(10) &  Chr(13) & Chr(10) & "Please install Kryopit and then run this program again!!!",0,"File Error!"
  50. End If

Could someone with a bit of time on their hands port this over for me? I'm such a n00b it's unbelievable!

Thanks guys!