Jump to content

START MENU


dazza
 Share

Recommended Posts

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

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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?

Link to comment
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. :)

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...