Jump to content



Photo

Shellexecute an all in one use?


  • Please log in to reply
4 replies to this topic

#1 Morthawt

Morthawt

    Music Maker

  • Active Members
  • PipPipPipPipPipPip
  • 350 posts

Posted 27 April 2012 - 08:34 PM

I am rewriting my string based hotkey program based on what I learned from the experience of writing the first one and want to slim down the user requirement to select between run vs shellexecute. From what I am reading in the manual it looks like shellexecute will do everything I need, run exe, scr, msc everything. Is there really any need for me to use Run function?





#2 MilesAhead

MilesAhead

    Eclectician

  • Active Members
  • PipPipPipPipPipPip
  • 531 posts

Posted 27 April 2012 - 08:42 PM

From looking in the help it seems that Run makes it easy to do things like redirect console output of the program being run etc.. ShellExecute is very versatile. I use ShellExecute or ShellExecuteWait for pretty much everything.

Edited by MilesAhead, 27 April 2012 - 08:42 PM.

"I don't want to belong to any club that would have me as a member."- Groucho Marx

#3 Morthawt

Morthawt

    Music Maker

  • Active Members
  • PipPipPipPipPipPip
  • 350 posts

Posted 27 April 2012 - 08:46 PM

Ok cool, I was going to write in a detection of the extension and decide which to use. But might as well use shell since I can still use parameters in the separate field. Thanks

#4 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,834 posts

Posted 28 April 2012 - 09:01 PM

One of the reasons to use Run over ShellExecute is that Run returns the PID of the program being run, while shellexecute only returns 1 or 0. Another reason to use Run is if you need to read the stdout/stderror streams of a program, such as a DIR command or a program that outputs data to the command window like Xcopy or RoboCopy. If you don't need these, then ShellExecute should work most of the time.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#5 Morthawt

Morthawt

    Music Maker

  • Active Members
  • PipPipPipPipPipPip
  • 350 posts

Posted 29 April 2012 - 02:03 AM

Well so far its working perfectly in the new version.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users