| View previous topic :: View next topic |
| Author |
Message |
JamesVan
Joined: 01 Oct 2007 Posts: 17
|
Posted: Thu Dec 20, 2007 4:14 pm Post subject: Using ProgramFiles variable in Windows XP 64 |
|
|
Has anyone tried to find and/or launch applications with AHK scripts running on Windows XP 64? For some reason, code I've written (example below) doesn't seem to find anything...
| Code: | AppPath64 = %A_ProgramFiles%\Revit Architecture 2008 - x64 Beta\Program
FLAG64 = 0
IfExist, %AppPath64%\Revit.exe
{
MsgBox, 4, Revit Architecture 64-Bit Beta found. Would you like to configure its settings also?
IfMsgBox, No
{
FLAG64 = 0
}
IfMsgBox, Yes
{
FLAG64 = 1
}
} |
The code above is looking for a 64-bit program installed in C:\Program Files and never gets to display the message box. |
|
| Back to top |
|
 |
Erittaf
Joined: 03 Nov 2007 Posts: 182
|
Posted: Thu Dec 20, 2007 10:38 pm Post subject: |
|
|
| in that version of windows there are 2 program files directories. (I think one of them has an (x86) or something behind it) It is likely AHK is pointing to the wrong one... I would suggest hardcoding it for the time being |
|
| Back to top |
|
 |
JamesVan
Joined: 01 Oct 2007 Posts: 17
|
Posted: Fri Dec 21, 2007 3:58 pm Post subject: |
|
|
Yes, I've tried a hard-coded search as in the example below, but it still can't find the files under "C:\Program Files (x86)". Could it be that the parentheses are confusing AutoHotKey?
| Code: | IfExist, "%ProgramFiles%\Autodesk\Worksharing Monitor for Revit 2008\WorksharingMonitor.exe"
{
msgbox,Found regular version.
Run "%ProgramFiles%\Autodesk\Worksharing Monitor for Revit 2008\WorksharingMonitor.exe"
}
else
{
msgbox,Can't find regular version.
}
IfExist, "C:\Program Files (x86)\Autodesk\Worksharing Monitor for Revit 2008\WorksharingMonitor.exe"
{
msgbox,Found x86 version.
Run "C:\Program Files (x86)\Autodesk\Worksharing Monitor for Revit 2008\WorksharingMonitor.exe"
}
else
{
msgbox,Can't find x86 version.
}
exitapp |
|
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1159 Location: Denmark
|
Posted: Fri Dec 21, 2007 4:39 pm Post subject: |
|
|
This works perfectly on a vista 64 bit - no "'s.
| Code: | | Run, C:\Program Files (x86)\Windows Mail\WinMail.exe |
_________________ there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face
- Kashmir |
|
| Back to top |
|
 |
JamesVan
Joined: 01 Oct 2007 Posts: 17
|
Posted: Fri Dec 21, 2007 10:32 pm Post subject: |
|
|
Figured it out. In Windows XP64, if you run SET in a DOS prompt you will see the variable "ProgramFiles" as well as a new one - "ProgramFiles(x86)". This led me to believe that the original "ProgramFiles" now refers to the 64-bit program installation path which is still C:\Program Files\. 32-bit programs installed on XP64 get installed in C:\Program Files (x86)\; however, when AHK calls %A_ProgramFiles% in XP64, you get C:\Program Files (x86)\.
I had my search options backwards. |
|
| Back to top |
|
 |
|