Sign in to follow this  
Followers 0
dazza

START MENU

19 posts in this topic

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.

Share this post


Link to post
Share on other sites



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)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

No. These are not questions:

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)

These are questions:

How do I start the command prompt by automating the start menu?

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I did request to keep it friendly but your arrogance over-rode commonsense.

Best leave this thread for another guru to answer.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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. :)

Share this post


Link to post
Share on other sites

#13 ·  Posted (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 by Manadar

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Brilliant. Thanks Bowmore. And if the @error returns a 0, I can assume the Command prompt is not in the path provided.

Thanks again

Share this post


Link to post
Share on other sites

#16 ·  Posted (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 by Mat

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

Great stuff - that's more than I need.

You guys have restored my faith in this forum (specifically this thread).

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0