Could you add something like this instead (please correct the syntax, I
haven't been a Visual Basic programmer in 10 years):
tmpdir = fso.BuildPath(fso.GetSpecialFolder(TemporaryFolder))
if !tmpdir.isWritable
tmpdir = fso.BuildPath(shell.ExpandEnvironmentStrings("%TMP%"))
linkfile = fso.BuildPath(tmpdir, "Git Bash.lnk")
This way, existing setups where nothing was broken will not change their
behavior.
Ciao,
Johannes
The problem is that nothing imported the enum symbols so it doesn't
actually understand 'TemporaryFolder'. If you use the documented value
of 2 then it works. According to the documentation for
GetSpecialFolder, passing in 2 will return the value of TMP anyway. As
an example create a file test.vbs with:
Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
WScript.Echo oFSO.GetSpecialFolder(2)
and run it using cscript test.vbs. If you use the word
'TemporaryFolder' then it treats it as 0 which is the value to obtain
the windows folder.
Cool, thanks!
Ciao,
Dscho