scripting help
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!
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
Answers (4)
Please log in to answer
Posted by:
anonymous_9363
17 years ago
What is it with these posts?!?
This is basic stuff:. Please don't be lazy. There must be 100,000 examples downloadable from the web.
http://www.computerperformance.co.uk/vbscript/index.htm
http://cwashington.netreach.net/depo/default.asp?topic=repository&ScriptType=vbscript&SubType=FileSystem
http://www.jsware.net/jsware/scripts.php3#filfol
This is basic stuff:. Please don't be lazy. There must be 100,000 examples downloadable from the web.
http://www.computerperformance.co.uk/vbscript/index.htm
http://cwashington.netreach.net/depo/default.asp?topic=repository&ScriptType=vbscript&SubType=FileSystem
http://www.jsware.net/jsware/scripts.php3#filfol
Posted by:
jamsek19
17 years ago
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
[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
Posted by:
aogilmor
17 years ago
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)
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)
Posted by:
AngelD
17 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.