View Full Version : OT: Does anyone know VB?
Dragonswrd
April 21st, 2004, 05:45 PM
I am writing a program that needs to delete a file, but I can't find the command or the syntax to make it delete the file. Any help would be useful.
Suicide Junkie
April 21st, 2004, 05:48 PM
kill "filename"
Dragonswrd
April 21st, 2004, 06:06 PM
It worked. Thank you very much. Do you by any chance know how to delete a registry entry under VB? I am writing a program, not a virus by the way, that will delete a specified file and registry entry. http://forum.shrapnelgames.com/images/icons/icon10.gif
Suicide Junkie
April 21st, 2004, 08:11 PM
Nope. I just use regedit.
Dragonswrd
April 21st, 2004, 08:32 PM
Oh well, thanks for the other help.
Parasite
April 21st, 2004, 10:35 PM
Try the "DeleteSetting" function. Use "GetSetting" to pullinfo out.
Dragonswrd
April 22nd, 2004, 03:20 PM
I thought of that, but that only lets you delete something from the VB section of the registry.
Parasite
April 22nd, 2004, 05:23 PM
I looked and there is also a "RegDelete" method. I don't really call it VB since it is a windows call. I have not used it, but the MSDN help looked like it might be what you need.
</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
[VBScript]
Dim WshShell, bKey
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCU\Software\ACME\FortuneTeller\", 1, "REG_BINARY"
WshShell.RegWrite "HKCU\Software\ACME\FortuneTeller\MindReader", "Goocher!", "REG_SZ"
bKey = WshShell.RegRead("HKCU\Software\ACME\FortuneTeller \")
WScript.Echo WshShell.RegRead("HKCU\Software\ACME\FortuneTeller \MindReader")
WshShell.RegDelete "HKCU\Software\ACME\FortuneTeller\MindReader"
WshShell.RegDelete "HKCU\Software\ACME\FortuneTeller\"
WshShell.RegDelete "HKCU\Software\ACME\"</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">
Ed Kolis
April 23rd, 2004, 12:20 AM
Is this by any chance VB .NET? The .NET runtime has some handy classes for manipulating the registry http://forum.shrapnelgames.com/images/icons/icon6.gif
Dragonswrd
April 23rd, 2004, 02:53 PM
Regretably, I don't know anything about VB.Net.
vBulletin® v3.8.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.