Jump to content

Recommended Posts

  • Moderators
Posted

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

  Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Expand  

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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:

  Reveal hidden contents

 

Posted (edited)

I personally find it easier to use Run(Wait) instead of ShellExecute(Wait). Once you find the syntax for the command in the command prompt, it's relatively easy to setup

; Setup your command
Local $sCmd = "dir /b"

; Run the command (See the helpfile for @Comspec & " /c " note)
Local $iPid = Run(@COMSPEC & " /c " & $sCmd, "", @SW_HIDE, $STDERR_MERGED)
If @error then Exit ConsoleWrite("Run Error: " & @error & " Extended: " & @extended)

; Wait for the command to finish running
ProcessWaitClose($iPid)

; Get the output of the command
Local $sOutput = StdoutRead($iPid)

Someone recently made a nice function for this... maybe argumentum? I'll edit and post a link if I find it

Edit: Found it
Edit 2: Nicer link

Edited by seadoggie01

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

  Reveal hidden contents
Posted

Not if it is not the problem of programming it, it is that I do not see the way to execute it directly in powershell to test if it works ... that is the problem

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
  • Recently Browsing   0 members

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