CScript.exe Tool on x64

General questions about using TextPad

Moderators: AmigoJack, helios, bbadmin, Bob Hansen, MudGuard

Post Reply
User avatar
ds0934
Posts: 41
Joined: Thu Nov 18, 2004 2:06 pm
Location: Virginia, USA
Contact:

CScript.exe Tool on x64

Post by ds0934 »

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.

Code: Select all

Set objShell = CreateObject("Wscript.Shell")
wscript.echo objShell.ExpandEnvironmentStrings("%programfiles%")
wscript.echo objShell.ExpandEnvironmentStrings("%programfiles(x86)%")
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"?
Post Reply