VBScript script to read registry key for location of target directory

pull/11/head
Nicholas Hope 2022-08-07 15:49:07 -04:00
parent 2ff3eba84c
commit a682acdbc6
1 changed files with 19 additions and 0 deletions

19
src/tfscript/findSA.vbs Normal file
View File

@ -0,0 +1,19 @@
Function ReadFromRegistry(strRegistryKey, strDefault)
Dim WSHShell, value
On Error Resume Next
Set WSHShell = CreateObject("WScript.Shell")
value = WSHShell.RegRead( strRegistryKey )
If err.number <> 0 Then
readFromRegistry = strDefault
Else
readFromRegistry = value
End If
Set WSHShell = Nothing
End Function
str = readFromRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Valve\Steam\InstallPath", "InstallPath")
wscript.echo "The value is " & str & "steamapps\common\Team Fortress 2\tf\cfg"