Log in

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(&quot;WScript.Shell&quot;)

WshShell.RegWrite &quot;HKCU\Software\ACME\FortuneTeller\&quot;, 1, &quot;REG_BINARY&quot;
WshShell.RegWrite &quot;HKCU\Software\ACME\FortuneTeller\MindReader&quot;, &quot;Goocher!&quot;, &quot;REG_SZ&quot;

bKey = WshShell.RegRead(&quot;HKCU\Software\ACME\FortuneTeller \&quot;)
WScript.Echo WshShell.RegRead(&quot;HKCU\Software\ACME\FortuneTeller \MindReader&quot;)

WshShell.RegDelete &quot;HKCU\Software\ACME\FortuneTeller\MindReader&quot;
WshShell.RegDelete &quot;HKCU\Software\ACME\FortuneTeller\&quot;
WshShell.RegDelete &quot;HKCU\Software\ACME\&quot;</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.