CScript.exe Tool on x64
Posted: Tue Sep 18, 2012 2:00 am
I'm confused by an issue with using the "Tools" feature in TextPad 6 with respect the following example VBScript code. I am working on a Windows 7 (SP1) 64-bit computer.
If I open a CMD console and explicitly invoke C:\Windows\System32\cscript.exe, it returns the correct values for each of these variables. If I explicitly invoke C:\Windows\SysWow64\cscript.exe, however, it returns "C:\Program Files (x86)" for both of them, which is incorrect (for 64-bit use).
However, this is where it gets weird with TextPad 6: When I create a Tool via "Program" and select either one of those "cscript.exe" files, it returns the same results no matter what (the wrong results). It is always referencing the "cscript.exe" under SysWow64. Is this a bug or a "feature"?
Code: Select all
Set objShell = CreateObject("Wscript.Shell")
wscript.echo objShell.ExpandEnvironmentStrings("%programfiles%")
wscript.echo objShell.ExpandEnvironmentStrings("%programfiles(x86)%")However, this is where it gets weird with TextPad 6: When I create a Tool via "Program" and select either one of those "cscript.exe" files, it returns the same results no matter what (the wrong results). It is always referencing the "cscript.exe" under SysWow64. Is this a bug or a "feature"?