Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Working...not working

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1307
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Working...not working
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Working...not working - 8/30/2004 7:49:07 AM   
  Revenger

 

Posts: 9
Score: 0
Joined: 8/26/2004
From: Malta
Status: offline
Hi mates, for some reason my tool isn't working. It runs but it doesn't do what is it programmed to do. Here is the source:

'Removal tool for VBS.Gaggle.E
'Programmer: Christian Busuttil
'Date: 7/10/2004

Dim MyBox1, MyBox2
MyBox1 = MsgBox("Do you want to Continue?", vbYesNo + vbQuestion, "VBS.Gaggle.E Removal Tool")

If MyBox1 = vbYes Then
MyBox2 = MsgBox("Started Removal", vbOKOnly + vbInformation, "VBS.Gaggle.E Removal Tool")
ElseIf MyBox1 = vbNo Then
WScript.quit
End If

Sub RegDelete1
On Error Resume Next
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Israfel.vbs")
WScript.RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Kernel32.win")
End Sub

Sub FileAttrs
On Error Resume Next
Dim fs, f1, f2, f3, f4, f5, f6, f7, f8
Set fs = CreateObject("Scripting.FileSystemObject")
Set f1 = fs.GetFile("C:\WINDOWS\System32\File.vbs")
f1.attributes = 0
Set f2 = fs.GetFile("C:\WINDOWS\System32\Gedzac.vbs")
f2.attributes = 0
Set f3 = fs.GetFile("C:\WINDOWS\System32\Israfel.vbs")
f3.attributes = 0
Set f4 = fs.GetFile("C:\WINDOWS\System32\Kernel32.win")
f4.attributes = 0
Set f5 = fs.GetGile("C:\WINDOWS\System32\Winmgd.win")
f5.attributes = 0
Set f6 = fs.GetFile("C:\WINDOWS\System32\Backup.vbs")
f6.attributes = 0
Set f7 = fs.GetFile("C:\WINDOWS\System32\Filezip.zip")
f7.attributes = 0
Set f8 = fs.GetFile("C:\WINDOWS\System32\Template.htm")
f8.attributes = 0
End Sub

Sub Removal1
On Error Resume Next
Set fs = CreateObject("Scripting.FileSystemObject")
Set f1 = fs.DeleteFile("C:\WINDOWS\System32\File.vbs")
Set f2 = fs.DeleteFile("C:\WINDOWS\System32\Gedzac.vbs")
Set f3 = fs.DeleteFile("C:\WINDOWS\System32\Israfel.vbs")
Set f4 = fs.DeleteFile("C:\WINDOWS\System32\Kernel32.win")
Set f5 = fs.DeleteFile("C:\WINDOWS\System32\Winmgd.win")
Set f6 = fs.DeleteFile("C:\WINDOWS\System32\Backup.vbs")
Set f7 = fs.DeleteFile("C:\WINDOWS\System32\Filezip.zip")
Set f8 = fs.DeleteFile("C:\WINDOWS\System32\Template.htm")
End Sub

Sub FileAttrs2
On Error Resume Next
Dim fs, f9, f10, f11, f12, f13, f14, f15, f16
Set fs = CreateObject("Scripting.FileSystemObject")
Set f9 = fs.GetFile("C:\WINDOWS\System32\Regsrv.exe")
f9.attributes = 0
Set f10 = fs.GetFile("C:\WINDOWS\System32\Sendi.exe")
f10.attributes = 0
Set f11 = fs.GetFile("C:\WINDOWS\System32\Pkzip.exe")
f11.attributes = 0
Set f12 = fs.GetFile("C:\WINDOWS\System32\AvrilLavigne.jpg")
f12.attributes = 0
Set f13 = fs.GetFile("C:\WINDOWS\System32\iwn.dat")
f13.attributes = 0
Set f14 = fs.GetFile("C:\WINDOWS\System32\iw.dat")
f14.attributes = 0
Set f15 = fs.GetFile("C:\WINDOWS\System32\ixn.dat")
f15.attributes = 0
Set f16 = fs.GetFile("C:\WINDOWS\System32\ix.dat")
f16.attributes = 0
End Sub


Sub Removal2
On Error Resume Next
Set fs = CreateObject("Scripting.FileSystemObject")
Set f9 = fs.DeleteFile("C:\WINDOWS\System32\Regsrv.exe")
Set f10 = fs.DeleteFile("C:\WINDOWS\System32\Sendi.exe")
Set f11 = fs.DeleteFile("C:\WINDOWS\System32\Pkzip.exe")
Set f12 = fs.DeleteFile("C:\WINDOWS\System32\AvrilLavigne.jpg")
Set f13 = fs.DeleteFile("C:\WINDOWS\System32\iwn.dat")
Set f14 = fs.DeleteFile("C:\WINDOWS\System32\iw.dat")
Set f15 = fs.DeleteFile("C:\WINDOWS\System32\ixn.dat")
Set f16 = fs.DeleteFile("C:\WINDOWS\System32\ix.dat")
End Sub

Sub RegRev
On Error Resume Next
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
Wscript.quit WshShell.RegWrite("HKEY_CLASSES_ROOT\regfile\shell\open\command\", "regedit.exe %1")
End Sub

Dim MyBox3
MyBox3 = MsgBox("Removal Finished", vbInformation + vbOkOnly, "VBS.Gaggle.E Removal Tool")

Do you Have any ideas what could be the problem pls? Thankx in advance for your help.

Regards
Revenger
 
 
Post #: 1
 
 Re: Working...not working - 8/30/2004 9:12:36 AM   
  mbouchard


Posts: 1906
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
First I would remove the on error's and see if there is any issue with the code.

(in reply to Revenger)
 
 
Post #: 2
 
 Re: Working...not working - 8/30/2004 9:14:04 AM   
  mbouchard


Posts: 1906
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
Also, where are you calling your subs from?

(in reply to Revenger)
 
 
Post #: 3
 
 Re: Working...not working - 8/30/2004 10:01:30 AM   
  Revenger

 

Posts: 9
Score: 0
Joined: 8/26/2004
From: Malta
Status: offline
I have removed the On Error Resume Next and when i executed the tool it didn't returned any error. What do you mean from where i'm calling the subs?

(in reply to Revenger)
 
 
Post #: 4
 
 Re: Working...not working - 8/30/2004 10:52:21 AM   
  GMKrullen

 

Posts: 3
Score: 0
Joined: 8/30/2004
From:
Status: offline
quote:

      


Looks like your just showing a MsgBox if the user clicks yes, after displaying the MsgBox code have your Sub procedures called upon.

(in reply to Revenger)
 
 
Post #: 5
 
 Re: Working...not working - 8/30/2004 12:11:41 PM   
  Revenger

 

Posts: 9
Score: 0
Joined: 8/26/2004
From: Malta
Status: offline
You mean like the following:

Dim MyBox1, MyBox2
MyBox1 = MsgBox("Do you want to Continue?", vbYesNo + vbQuestion, "VBS.Gaggle.E Removal Tool")
If MyBox1 = vbYes Then
MyBox2 = MsgBox("Started Removal", vbOKOnly + vbInformation, "VBS.Gaggle.E Removal Tool")

Subs here...
....

ElseIf MyBox1 = vbNo Then
wscript.quit
End If

Regards
Revenger

(in reply to Revenger)
 
 
Post #: 6
 
 Re: Working...not working - 8/30/2004 2:42:51 PM   
  mbouchard


Posts: 1906
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
Something like this

Dim MyBox1, MyBox2
MyBox1 = MsgBox("Do you want to Continue?", vbYesNo + vbQuestion, "VBS.Gaggle.E Removal Tool")
If MyBox1 = vbYes Then
MyBox2 = MsgBox("Started Removal", vbOKOnly + vbInformation, "VBS.Gaggle.E Removal Tool")

Call Sub1

Call sub2

etc.
ElseIf MyBox1 = vbNo Then
wscript.quit
End If

(in reply to Revenger)
 
 
Post #: 7
 
 Re: Working...not working - 8/31/2004 12:40:53 AM   
  mbouchard


Posts: 1906
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
Revenger,

Now that i had a little time to look at this, there might be a way to better go through all of the files and delete them. Check out what I have.


      

(in reply to Revenger)
 
 
Post #: 8
 
 Re: Working...not working - 8/31/2004 1:31:03 AM   
  Revenger

 

Posts: 9
Score: 0
Joined: 8/26/2004
From: Malta
Status: offline
Hi mate, I have tried using the Call Sub but didn't seem to work. Your code seems to be more complicated, what about DelThisFile? What function is that? I cannot really understand...this tool used to work perfectly. Also a friend of mine once tested it on his machine..and it worked..i'm really out of ideas. U have more?

(in reply to Revenger)
 
 
Post #: 9
 
 Re: Working...not working - 8/31/2004 1:59:17 AM   
  mbouchard


Posts: 1906
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
Revenger,

I think the Array is the most complicated part of the script and if you don't feel comfortable with using them (I am just starting to use them myself) here is the same script with out the Array.

Basically what I did was take everything in the sub FileAttrs (1 and 2) and the removal (1 and 2) which are about 69 lines and brought them down to 25 lines.

There are the call statements at the top, which call the removal sub at the bottom. The Removal sub does the same thing as the Fileattrs and removal sub from the original script just in less lines and a little cleaner. I have tested this out and have gotten the delete working. have not touched the regdelete/write at all.

One question I have, will this script only be used on WindowsXP? or will you ever use it on 2000/NT4?

Let me know if you have any questions.

Mike

quote:

      

(in reply to Revenger)
 
 
Post #: 10
 
 Re: Working...not working - 8/31/2004 3:42:44 AM   
  Revenger

 

Posts: 9
Score: 0
Joined: 8/26/2004
From: Malta
Status: offline
Let me and code it in the way u put it. I don't like copying your code word by word. About your question, at first i was going to make two versions, one for windows xp and one for windows 95/98 but i think it will be better to put everything in one.

(in reply to Revenger)
 
 
Post #: 11
 
 Re: Working...not working - 8/31/2004 6:50:47 AM   
  mbouchard


Posts: 1906
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
Look at the GetSpecialFolder Method that would get you the Windows folder.

(in reply to Revenger)
 
 
Post #: 12
 
 Re: Working...not working - 8/31/2004 8:25:14 AM   
  GMKrullen

 

Posts: 3
Score: 0
Joined: 8/30/2004
From:
Status: offline
Hey Revenger,

Is your code working for you now [?]
Have you tried doing something like this:


      

I hope all goes well for you. Good Luck

(in reply to Revenger)
 
 
Post #: 13
 
 Re: Working...not working - 8/31/2004 12:14:26 PM   
  Revenger

 

Posts: 9
Score: 0
Joined: 8/26/2004
From: Malta
Status: offline
Perfect! It's working! Let me add some final touches and i will post the new source code :) Thankx a lot for your help mbouchard and GMKrullen .

Regards
Revenger

(in reply to Revenger)
 
 
Post #: 14
 
 Re: Working...not working - 8/31/2004 1:32:06 PM   
  GMKrullen

 

Posts: 3
Score: 0
Joined: 8/30/2004
From:
Status: offline
not a problem bud, glad to hear you have it working.

(in reply to Revenger)
 
 
Post #: 15
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Working...not working Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts