Jump to content

Recommended Posts

Posted

I have written a script to dial a modem using rasdial. When i am not able to connect, i run rasdial in command prompt to see what the error is.

Is it possible to redirect the output of rasdial command in the script to a traytip?

Posted

I have written a script to dial a modem using rasdial. When i am not able to connect, i run rasdial in command prompt to see what the error is.

Is it possible to redirect the output of rasdial command in the script to a traytip?

Try this:

_RunDOS("rasdial >" & @TempDir & "\DOS_OUTPUT.DAT")
$FILE = FileOpen(@TempDir & "\DOS_OUTPUT.DAT",0)
$DATA = FileRead($FILE)
FileClose($FILE)
TrayTip("RASDIAL",$DATA,5)
Sleep(5000)

Func _RunDOS($sCommand)
    Local $nResult = RunWait(@ComSpec & " /C " & $sCommand, "", @SW_HIDE)
    Return SetError(@error, @extended, $nResult)
EndFunc  ;==>_RunDOS

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