Jump to content

Recommended Posts

Posted (edited)

I think maybe the _RunDos() Functions needs a little bit more information, instead of just the example. Maybe this to start.

Return Value:

Success - Returns the exit code of the command

Failure - Depends on RunErrorsFatal setting

Remarks: When piping DOS (console) commands, to a file, you must use the 8.3 short path+name(Shortname) as the destination.

Related: Run, RunAsSet

Examples:

; Ex. #1:

#include <Process.au3>

$rc = _RunDos("start Http://www.autoitscript.com")


; Ex. #2:

#include <Process.au3>

$rc = _RunDos("dir > " & FileGetShortName(@ScriptDir) & "temp.txt") 
;Pipes the 'dir' command to "temp.txt", located in the running script directory

Edit: Then again maybe it should be up to the user to know they need to use the shortname, and then the above information could/should/might be included in the remarks for Run() as it does comment on how to run DOS commands.

Edited by Burrup

qq

Posted

_RunDos("dir > " & FileGetShortName(@ScriptDir) & "temp.txt");mine
_RunDos('dir > "' & FileGetShortName(@ScriptDir) & '\temp.txt"');yours

Both work.

qq

Posted

I think maybe the _RunDos() Functions needs a little bit more information, instead of just the example. Maybe this to start.

Remarks: When piping DOS (console) commands, to a file, you must use the 8.3 short path+name(Shortname) as the destination.

$rc = _RunDos("dir > " & FileGetShortName(@ScriptDir) & "temp.txt")

;Pipes the 'dir' command to "temp.txt", located in the running script directory

> Redirects output.

| Pipes input to output.

:)

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
×
×
  • Create New...