/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


scripting help

09/26/2007 4478 views
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


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

All 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

2
Answered 09/27/2007 by: anonymous_9363
Red Belt

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
9th Degree Black Belt

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

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ