pr1 Posted October 7, 2010 Share Posted October 7, 2010 Hello, is there a way to run a third-party Windows application (such as Acrobat Reader, AcroRd32.exe) without specifying its full path? For instance, I would like to do this: Run <or any other command>("AcroRd32.exe", "", ...) instead of Run("C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe", "", ...). Like that, I could call any version of Acrobat Reader (7, 8, or 9) on any machine, without knowing its full path. Many thanks. pr1 Link to comment Share on other sites More sharing options...
jaberwacky Posted October 7, 2010 Share Posted October 7, 2010 (edited) I just did it with Firefox and it worked fine. Run("Firefox.exe"). I don't have Acrobat Reader or I'd test that for you.Edit: It fails for Foxit Reader.Ok well, I'm done, sorry.*facePALM* Maybe it worked for Firefox becuase I already had it open? Edited October 7, 2010 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
wakillon Posted October 7, 2010 Share Posted October 7, 2010 I don't think so ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Ascend4nt Posted October 7, 2010 Share Posted October 7, 2010 pr1, Unless its added to the initial 'Path' environment string, you'll need to put the full path in. If you want it to be able to be run on other configurations though (where it could be installed to a different folder), you might want to search the registry for any keys that point to the folder and/or executable, and use the path found there. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
trung0407 Posted October 7, 2010 Share Posted October 7, 2010 (edited) just verify if the application exists then execute it Example: for $i= 7 to 9 if FileExists("link to app...number of version store in variable $i") then Run("C:\Program Files\Adobe\Reader " & $i & ".0\Reader\AcroRd32.exe", "", ...). exitloop endif next Edited October 7, 2010 by trung0407 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now