Can anyone tell me how to write a VBscript or write one for me that would do the following:

1)delete the directory c:\program files\program1
2)delete these registry keys no matter what value it contains without any promt [HKEY_LOCAL_MACHINE\SOFTWARE\Doris] and [HKEY_LOCAL_MACHINE\SOFTWARE\Doris2]

thanks!
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Deleting folder and all subfolders
[font="courier new"]Set FSObj = CreateObject("Scripting.FileSystemObject")
FolderName="c:\temp"
FSObj.DeleteFolder FolderName, True
[font="courier new"]Set FSObj = Nothing


To delete a single property "property_to_delete" and its value:
[font="courier new"]Set WSHShellObj = CreateObject("WScript.Shell")
regKey = "HKLM\SOFTWARE\ApplSrvTmp\property_to_delete"
WSHShellObj.RegDelete regKey
[font="courier new"]Set [font="courier new"]WSHShellObj[font="courier new"] = Nothing

To delete a single key:
[font="courier new"]Set WSHShellObj = CreateObject("WScript.Shell")
regKey = "HKLM\SOFTWARE\ApplSrvTmp\key_to_delete\"
WSHShellObj.RegDelete regKey
[font="courier new"]Set [font="courier new"]WSHShellObj[font="courier new"] = Nothing
Answered 09/27/2007 by: jamsek19
Orange Senior Belt

Please log in to comment
2
Answered 09/27/2007 by: VBScab
Red Belt

Please log in to comment
0
I have held my tongue thus far, but I tend to agree with you. It really doesn't pertain to packaging, and there are a bajillion examples on the web.

I think some of these folks want their scripts written for them.

I won't do that for free, but my consulting rate is available on request! (occasionally I might post a code snippet to help someone if I have time, and to get the practice, but that's it....and it's gotta be something more interesting than "how do I delete a folder?"....there's a not so fine line between contributing to the scripting community and doing someone's work for them)
Answered 09/27/2007 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
0
I moved this to the correct forum as it doesn't seem to relate to packaging as Owen (aogilmor) already mentioned.
Please try to post to the related forum and use the search function in the future as there are tons of similar and useful scripts already posted at the different forums.
Answered 09/27/2007 by: AngelD
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity