Jump to content

Recommended Posts

Posted

MsgBox(64, 'Date', _getDOSOutput('date /t'))
Func _getDOSOutput($command)
    Local $text = '', $Pid = Run('"' & @ComSpec & '" /c ' & $command, '', @SW_HIDE, 2 + 4)
    While 1
        $text &= StdoutRead($Pid, False, False)
        If @error Then ExitLoop
        Sleep(10)
    WEnd
    Return $text
EndFunc ;==>_getDOSOutput

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Posted

MsgBox(64, 'Date', _getDOSOutput('date /t'))
Func _getDOSOutput($command)
    Local $text = '', $Pid = Run('"' & @ComSpec & '" /c ' & $command, '', @SW_HIDE, 2 + 4)
    While 1
        $text &= StdoutRead($Pid, False, False)
        If @error Then ExitLoop
        Sleep(10)
    WEnd
    Return $text
EndFunc ;==>_getDOSOutput

i'm having the same problem with this one as i did with the one in the help file, it's not returning the results of a dsmove command

Posted

i'm having the same problem with this one as i did with the one in the help file, it's not returning the results of a dsmove command

What about when you call dsmove directly instead of calling the cmd shell first?

$OUT = ""
$PID = Run('dsmove.exe "CN=Kim Akers,OU=Sales,DC=Contoso,DC=Com" -newname "Kim Ralls"',@SCRIPTDIR,@SW_HIDE,7)
IF $PID THEN
 WHILE 1
    $OUT &= StdoutRead($PID)
    IF @ERROR THEN EXITLOOP
 WEND
ELSE
 $OUT = "Failed to execute program."
ENDIF
MsgBox(64,@SCRIPTNAME,$OUT)

Vlad

wtfpl-badge-1.png

Posted

What about when you call dsmove directly instead of calling the cmd shell first?

$OUT = ""
$PID = Run('dsmove.exe "CN=Kim Akers,OU=Sales,DC=Contoso,DC=Com" -newname "Kim Ralls"',@SCRIPTDIR,@SW_HIDE,7)
IF $PID THEN
 WHILE 1
    $OUT &= StdoutRead($PID)
    IF @ERROR THEN EXITLOOP
 WEND
ELSE
 $OUT = "Failed to execute program."
ENDIF
MsgBox(64,@SCRIPTNAME,$OUT)

Vlad

this probably would work but i eneded up just doing what i needed to do with a series of before and after checks and finished what i needed. but i'll probably put this in because it would make it better to see whether it wouldn't move because of access denied or not found, but i won't be able to check this for a while

thank you everyone for your responses

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