64-bit Bug / Cscript.exe Tool output
Posted: Thu Oct 06, 2011 11:30 pm
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.
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)
Code: Select all
Set objShell = CreateObject("Wscript.Shell")
wscript.echo objShell.ExpandEnvironmentStrings("%programfiles%")
wscript.echo objShell.ExpandEnvironmentStrings("%programfiles(x86)%")
C:\Program Files (x86)
C:\Program Files (x86)
Running the same script from within a CMD console...
C:\Program Files
C:\Program Files (x86)