I'm writing a script that will accomplish a few things. First is to check for a specific registry key, if that exists then the script will exit. If the key doesn't exist the script will check for a folder, if that does not exist it will create it. Lastly the script will call an msi install package.
I've got all the pieces of the puzzle, I just don't know how to tackle getting these to work together.
Dim objFSO, WshShell, newfolder
strComputer = "."
Set wshShell = CreateObject("WScript.Shell")
Set objRegistry = GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strKeyPath = "Software\Microsoft\Windows\Uninstall"
strValueName = "{3FE28AA5-8140-47E4-A0D3-974F24831556}"
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
If IsNull(strValue) Then
If Not objFSO.FolderExists("C:\Windows\Logs\") Then
newfolder = objFSO.CreateFolder("C:\Windows\Logs\")
Else
End If
That's the rough code. I left off the WshShell.Run variable only because that should be easy to plug in once I get these two playing nice.
Thank you.
I've got all the pieces of the puzzle, I just don't know how to tackle getting these to work together.
Dim objFSO, WshShell, newfolder
strComputer = "."
Set wshShell = CreateObject("WScript.Shell")
Set objRegistry = GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strKeyPath = "Software\Microsoft\Windows\Uninstall"
strValueName = "{3FE28AA5-8140-47E4-A0D3-974F24831556}"
objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
If IsNull(strValue) Then
If Not objFSO.FolderExists("C:\Windows\Logs\") Then
newfolder = objFSO.CreateFolder("C:\Windows\Logs\")
Else
End If
That's the rough code. I left off the WshShell.Run variable only because that should be easy to plug in once I get these two playing nice.
Thank you.