Traveler Posted November 17, 2011 Posted November 17, 2011 HiIs it possible to call a program via a similar below command, where the actual location of the program is unknown ? I do not know the exact location of the program, because the program has been installed in different ways on different machines during the years.runWait(@ComSpec & ' /c ' & "programname.exe", @TempDir, @SW_HIDE)
somdcomputerguy Posted November 17, 2011 Posted November 17, 2011 I guess, if programname.exe is in the current directory, or the systems path. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
UEZ Posted November 17, 2011 Posted November 17, 2011 If it is not found via the folders in the path variable then you have to search for it! Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Moderators Melba23 Posted November 17, 2011 Moderators Posted November 17, 2011 Traveler, Dredging up my memories of dear departed DOS, I think that will run as long as the app was installed somewhere on the path as set in the environment - or added its path to that variable when installed. If you wanted to be sure that was the case you could run something like this first: #include <Array.au3> ; Get an array of the paths in PATH $aPath = StringSplit(EnvGet("PATH"), ";") $fFound = False For $i = 1 To $aPath[0] ; Check for a trailing and add if required If StringRight($aPath[$i], 1) <> "" Then $aPath[$i] &= "" EndIf ; Now look for the file on this path If FileExists($aPath[$i] & "programmename.exe") Then ; We have found it $fFound = True ExitLoop EndIf Next If $fFound Then MsgBox(0, "", "Found it on " & $aPath[$i]) Else MsgBox(0, "", "Not going to run") EndIf Any help? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Traveler Posted November 17, 2011 Author Posted November 17, 2011 Hi I do not know the location except c: . On my current PC it's c:Program Fileslotusnotesprogramname.exe. To Melba23, when I run your program I get the message 'Not going to run'.
Moderators Melba23 Posted November 17, 2011 Moderators Posted November 17, 2011 (edited) Traveler,Look at the RecFileListToArray UDF in my sig - it will find the path for you if you specify the filename. Download it and then run this from the same folder - with the correct "folder" and "programmename" parameters: #include <Array.au3> #include "RecFileListToArray.au3" $aList = _RecFileListToArray("C:Program Files", "programmename.exe", 1, 1, 0, 2) _ArrayDisplay($aList)You should see a list of all instances of the app on that drive. For a big drive it will take a time - so make the "folder" specification as tight as you dare. I have suggested "Program Files" as as a good start point. Give it a try and see what you get. M23Edit: Typnig! Edited November 17, 2011 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Traveler Posted November 17, 2011 Author Posted November 17, 2011 If I just enter your new command in a new autoit.exe, then I'm told 'Error: unknown function name'. Maybe I misunderstood, and have to add your new string to your original suggestion ?
Moderators Melba23 Posted November 17, 2011 Moderators Posted November 17, 2011 Traveler,You need to download the file containing the RecFileListToArray UDF script (just click on the name in my sig and you will go to the thread where the latest version is available) and place it a folder. Create the script I just gave you in the same folder. Then when you run the small script it will find the include file in the same folder and will run - at least it does when I try it! A bit of explanation - "including" a file puts its code into the script at that point. So the #include "RecFileListToArray.au3" line is equivalent to you adding all of the UDF code to your script. Clear now? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
kylomas Posted November 17, 2011 Posted November 17, 2011 (edited) traveler,1 - somedcomputerguy has given you your answer...2 - what platform?3 - the message "not going to run" is probably being issued by your program (not a windows message) and your issue may be applications related4 - you can use the search facility by right clicking the start key to find any filekylomas Edited November 17, 2011 by kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
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