dazza Posted October 16, 2009 Share Posted October 16, 2009 I need to run the Command Prompt via the START MENU (as part of a regression test). So I need to know that the Command prompt is hanging off Programs->Accessories->Command Prompt, and then to run it from here. Thanking in advance. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 16, 2009 Share Posted October 16, 2009 What do you want to ask? github.com/jvanegmond Link to comment Share on other sites More sharing options...
dazza Posted October 16, 2009 Author Share Posted October 16, 2009 1) the Command prompt is hanging off Programs->Accessories 2) Run the command prompt via the start menu (I don't want to use key presses) Link to comment Share on other sites More sharing options...
jvanegmond Posted October 16, 2009 Share Posted October 16, 2009 It may be just me.. But a lack of questions in this thread greatly annoys me. github.com/jvanegmond Link to comment Share on other sites More sharing options...
dazza Posted October 16, 2009 Author Share Posted October 16, 2009 The questions are very clear; I even numbered them for you. These, in turn, are just cut from the initial entry. Let's just keep it friendly. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 16, 2009 Share Posted October 16, 2009 No. These are not questions:1) the Command prompt is hanging off Programs->Accessories2) Run the command prompt via the start menu (I don't want to use key presses)These are questions:How do I start the command prompt by automating the start menu? github.com/jvanegmond Link to comment Share on other sites More sharing options...
water Posted October 16, 2009 Share Posted October 16, 2009 (edited) I want to assist Manadar I can't see a question mark in your postings. I can see statements but no questions. And I think we are not going to guess the questions for you, solve this "questions" and maybe end up with the wrong solutions. So please post some questions we can answer. Edited October 16, 2009 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
dazza Posted October 16, 2009 Author Share Posted October 16, 2009 I did request to keep it friendly but your arrogance over-rode commonsense. Best leave this thread for another guru to answer. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 16, 2009 Share Posted October 16, 2009 My only wish is to assist you in the best way possible. This is why I ask you to formulate a logical question so that I can give a logical answer. If anyone here is being arrogant, it is you in failing to understand how to ask a question. github.com/jvanegmond Link to comment Share on other sites More sharing options...
dazza Posted October 16, 2009 Author Share Posted October 16, 2009 1) How do I get autoIT to check what's on the Start Menu 2) How do get AutoiT to run an application via the Start Menu If this is not clear enough then I am out on paraphrazing. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 16, 2009 Share Posted October 16, 2009 I still don't quite understand what you're trying to do here. You're not being specific, at all.. Are you a system administrator or something? To get AutoIt to do what you want, you write an AutoIt script with a number of commands and you tell AutoIt to execute that script. This answers both of your questions. However, in the interest of you not becoming very angry with me. I'm going to take a wild guess and say you want to: Automate the start menu, using user input simulation, to start command prompt. Is this correct? github.com/jvanegmond Link to comment Share on other sites More sharing options...
dazza Posted October 16, 2009 Author Share Posted October 16, 2009 I see you edited out your first sarcastic comment. "To get AutoIt to do what you want, you write an AutoIt script with a number of commands and you tell AutoIt to execute that script" Everyone who posts on here knows that AutoIT is a scripting language that does stuff. This is a forum where people need lines of autoIT code to achive the questions raised. Answering with 'write a script' is you either taking the pi$$, or you're just being dense. And yes, I am slightly cross with you. You've wasted my time on this thread when someone else could have given me the answer 30 mins a go. I don't have time for you and your games. I'll await wisdom from someone who wants to help and not to hinder. Please no longer answer this thread. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 16, 2009 Share Posted October 16, 2009 (edited) I'll answer any thread as I see fit.Yes, I did edit my first sarcastic comment. I enjoy playing, but sometimes a little too much. Please forgive my desire to enjoy the things I do.Sorry for wasting your time. I still honestly do not understand precisely what you are trying to do, I hope for your sake that someone else will come along and automagically understands what you do mean.Good luck.Edit: Typo. Edited October 16, 2009 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
Bowmore Posted October 16, 2009 Share Posted October 16, 2009 Does this do what you want? It will open a command prompt window only if it is in the Accessories group on the current user's Start Menu. ShellExecute('"C:\Documents and Settings\' & @UserName & '\Start Menu\Programs\Accessories\Command Prompt"') "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
dazza Posted October 16, 2009 Author Share Posted October 16, 2009 Brilliant. Thanks Bowmore. And if the @error returns a 0, I can assume the Command prompt is not in the path provided. Thanks again Link to comment Share on other sites More sharing options...
Mat Posted October 16, 2009 Share Posted October 16, 2009 (edited) Trying to automate the start menu is hard... vary hard. I can get as far as accessories. #Include<GUIToolbar.au3> ControlClick ("[Class:Shell_TrayWnd]", "", "[CLASS:Button; INSTANCE:1]") WinWait ("[Class:DV2ControlHost]", "") ControlClick ("[Class:DV2ControlHost]", "", "[CLASS:Button; INSTANCE:1]") WinWait ("[Class:BaseBar]", "") $hWnd = ControlGetHandle ("[Class:BaseBar]", "", "[CLASS:ToolbarWindow32; INSTANCE:1]") $iCount = _GUICtrlToolbar_ButtonCount ($hWnd) For $i = 0 to $iCount $sText = _GUICtrlToolbar_GetButtonText ($hWnd, $i) If $sText = "Accessories" Then _GUICtrlToolbar_ClickButton ($hWnd, $i) Next Good Luck doing it that way, It's probably not even the best way either... Mat Edited October 16, 2009 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
TurionAltec Posted October 16, 2009 Share Posted October 16, 2009 Shortcuts shown in the start menu are stored in two places: @StartMenuCommonDir for the "All users" icons and @StartMenuDir for the current user's icons. $currentusercommandpath=@StartMenuDir&"\Programs\Accessories\Command Prompt.lnk" $allusercommandpath=@StartMenuCommonDir&"\Programs\Accessories\Command Prompt.lnk" If FileExists($currentusercommandpath) Then Msgbox(0,"Command prompt", "Exists in user's start menu") ShellExecute($currentusercommandpath) Else Msgbox(0,"Command prompt", "Doesn't Exist in user's start menu") EndIf If FileExists($allusercommandpath) Then Msgbox(0,"Command prompt", "Exists in all user's start menu") ShellExecute($currentusercommandpath) Else Msgbox(0,"Command prompt", "Doesn't Exist in all user's start menu") EndIf Won't tell you if the shortcut has been renamed. Easier way to start the commandprompt: Run(@comspec) Link to comment Share on other sites More sharing options...
dazza Posted October 19, 2009 Author Share Posted October 19, 2009 Great stuff - that's more than I need. You guys have restored my faith in this forum (specifically this thread). Link to comment Share on other sites More sharing options...
jvanegmond Posted October 19, 2009 Share Posted October 19, 2009 You've been given 3 different solutions, and I can think of a few more. Do you think it's strange that I asked you to be more specific? I am definitely not going to write down all the solutions that I know. github.com/jvanegmond 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