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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

KILL and Removing a registry entry and file

Status
Not open for further replies.

ch0s3n

Programmer
Jan 19, 2004
1
US
Okey first of all i am Really really new to Visual Basic (6) i'm makin a program that get's rid of a virus that infected people's computer when they went to buddypicture.net (now shut down but there is still alot of people infected) i got the rest all pretty but i'm havin some probs

1. i have this to try to kill the process

Code:
Private Sub Command1_Click()
 Kill "C:\WINDOWS\av.exe"
End Sub

and i get Run-Time error '53' file not found. but it DOES exist

2. i'm not so sure about the DeleteSetting command. i'm trying to get Private Sub Command5_Click() to remove the following setting from the registry.

the key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

and removing the string

AntiVirus REG-SZ c:\WINDOWS\av.exe

from that key

3. Sub Delete() is that the right thing to use to delete c:\windows\av.exe ? if it is could i get a hint on the Syntax?

Please help :p

Thanx alot

VB Newbie!



 
Hello, ch0s3n. I am not in Visual Basic programming but probably some hints can be of help to you. I don't know if 'kill' or 'Delete' is the sub that you use in VB to delete files. Since this is a WinAPI forum I can tell you that you can use the
Code:
DeleteFile
api call which probably 'kill' or 'delete' reference to in order to function. As for registry key removal you can use
Code:
RegDeleteValue
call. You can check their params in Win32 SDK. You should have it installed with your VB I guess. Otherwise, I am not so sure if VB has escape characters like C. If it does, you probably should write your 'kill' line like this:
Code:
Kill "C:\\WINDOWS\\av.exe"
in order to escape the backslash. This is how it is done in C for example. I don't say it will work that way but just it might. A VB programmer should be of greater help. Why don't you make a post to a Visual Basic programming forum. Try this one forum222 Tek-tips have more of these VB forums. You should check on those ones too. That's all from me. Hope it helps a bit.

best regards,
Ivan


A well-defined problem is half solved.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top