AutoHotkey Community

It is currently May 26th, 2012, 1:27 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: December 20th, 2007, 4:14 pm 
Offline

Joined: October 1st, 2007, 4:09 pm
Posts: 17
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2007, 10:38 pm 
Offline

Joined: November 3rd, 2007, 12:41 am
Posts: 188
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2007, 3:58 pm 
Offline

Joined: October 1st, 2007, 4:09 pm
Posts: 17
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2007, 4:39 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
This works perfectly on a vista 64 bit - no "'s.
Code:
Run, C:\Program Files (x86)\Windows Mail\WinMail.exe

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2007, 10:32 pm 
Offline

Joined: October 1st, 2007, 4:09 pm
Posts: 17
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, Google Feedfetcher, Retro Gamer, sjc1000 and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group