64-bit Bug / Cscript.exe Tool output

General questions about using TextPad

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

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

64-bit Bug / Cscript.exe Tool output

Post by ds0934 »

If you run the following code on a Windows 7 64-bit computer using the latest version of TextPad, it displays incorrect results for expanded environment variables through VBscript (cscript.exe). If you run the same code outside of TextPad it displays correctly.

Code: Select all

Set objShell = CreateObject("Wscript.Shell")
wscript.echo objShell.ExpandEnvironmentStrings("%programfiles%")
wscript.echo objShell.ExpandEnvironmentStrings("%programfiles(x86)%")
within TextPad, it shows...

C:\Program Files (x86)
C:\Program Files (x86)

Running the same script from within a CMD console...

C:\Program Files
C:\Program Files (x86)
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

That is not a bug and it's not TextPad that's doing it. TextPad is a 32-bit application. Windows arranges things so that when a 32-bit application thinks it's looking at the directory "C:\Program Files" it's actually looking at the directory "C:\Program Files (x86)".
Post Reply