Jump to content

dillonlim

Active Members
  • Posts

    42
  • Joined

  • Last visited

dillonlim's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Martin, Many thanks for this great UDF. I've used it in the past without any problems until I tried to connect to an Avocent Cyclades. I keep getting these extra characters which I can't seem to filter out. See attached picture. . I don't see these extra characters while viewing through HyperTerminal. How do I clean up those extra characters without messing up the output format? Thanks again.
  2. Sorry but I've never tried it on Win7. I only tested it on XP.
  3. Wrote this while I was bored at work. Not quite sure what value it adds to the console traceroute if any. #include <Constants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("Traceroute Thingy", 500, 500) GUICtrlCreateLabel("IP Address:", 10, 13, 60, 20) $ipaddress = GUICtrlCreateInput("", 80, 10, 200, 20) $start = GUICtrlCreateButton("TRACE", 300, 10, 80, 20) $clear = GUICtrlCreateButton("CLEAR", 400, 10, 80, 20) $display = GUICtrlCreateEdit("", 10, 40, 480, 420, $ES_READONLY) GUICtrlCreateLabel("Status:", 10, 473, 40, 20) $status = GUICtrlCreateEdit("Idle", 50, 470, 440, 20, $ES_READONLY) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $start Local $tracert = "" Local $st = 1 Local $tracestatus = "run" GUICtrlSetData($status, "Tracing route") $getip = GUICtrlRead($ipaddress) $troute = Run("cmd.exe /c tracert.exe -h 30 -w 10 " & $getip, "", @SW_HIDE, $STDOUT_CHILD) Do If $tracestatus = "run" Then $tracert &= StdoutRead($troute) If @error Then $tracestatus = "stop" EndIf EndIf $trace = StringStripCR($tracert) $tracesplit = StringSplit($trace, @CRLF) $arrayvar = UBound($tracesplit) If $st = $tracesplit[0] AND $tracestatus = "run" Then Sleep(500) ElseIf $arrayvar < 7 Then Sleep(500) ElseIf $st < $tracesplit[0] AND $arrayvar >= 7 Then $readchar = StringLeft($tracesplit[$st], 5) $cleanchar = StringStripWS($readchar, 8) If StringIsDigit($cleanchar) = 1 Then GUICtrlSetData($display, $tracesplit[$st] & @CRLF, 1) Sleep(1500) EndIf EndIf $st = $st + 1 Until $st = $tracesplit[0] AND $tracestatus = "stop" GUICtrlSetData($status, "Done") Case $msg = $clear GUICtrlSetData($ipaddress, "") GUICtrlSetData($display, "") GUICtrlSetData($status, "Idle") EndSelect WEnd GUIDelete()
  4. Wrote this a part of a framework for a friend's project. I've only tested it on x86 WinXP. It only works with Microsoft telnet client. It WILL fail with PuTTY, any third party telnet client and any flavor Linux/Unix telnet client. $port = "666" TCPStartup () $GIT = TCPListen(@IPAddress1, $port) If $GIT = -1 Then MsgBox(0, "Error", "Unable to start server on " & $port) Exit EndIf While 1 Do $GOT = TCPAccept($GIT) Until $GOT <> -1 TCPSend($GOT, "Command? ") While 1 $HAS = TCPRecv($GOT, 4096) $CHKVAR = StringLen($HAS) If $CHKVAR > 0 Then Local $HASSING = "" Do $HASSING &= TCPRecv($GOT, 4096) $CHKCHAR = StringRight($HASSING, 1) Until $CHKCHAR = ";" $HASSAN = StringTrimRight($HASSING, 1) $CMSG = $HAS & $HASSAN TCPSend($GOT, @CRLF & "Command? ") If StringLower($CMSG) <> "exit" Then TrayTip("i haz a msg", $CMSG, 5, 0) Else TrayTip("", "", 5, 0) EndIf Select Case StringLower($CMSG) = "exit" TCPSend($GOT, "Goodbye!") TCPCloseSocket($GOT) ExitLoop Case StringLower($CMSG) = "close" Send("!{F4}") Case StringLower($CMSG) = "return" Send("{ENTER}") Case StringLeft(StringLower($CMSG), 4) = "send" $TRIMMER = StringTrimLeft($CMSG, 5) Send($TRIMMER) Send("{ENTER}") Case StringLeft(StringLower($CMSG), 2) = "go" $TRIMMER = StringTrimLeft($CMSG, 3) ShellExecute($TRIMMER) EndSelect EndIf WEnd WEnd TCPShutDown()
  5. You can use the command line utility "devcon" from Microsoft. Run "devcon status" and parse for the name of flash drive. Then run "devcon remove <device class>" to remove the flash drive. It is totally independent of the drive letter.
  6. Try this. $outlook = @ProgramFilesDir & "\Outlook Express\msimn.exe" ShellExecute($outlook, '/mailurl:mailto:"someone@somewhere.net?subject=Test&body=Hi')
  7. Try msimn /mailurl:mailto:"someone@somewhere.net?subject=Test&body=Hi That should open up Outlook Express and pre-populate the email address, subject, etc.
  8. You used to be able to call Windows Media Player from the command prompt and use the /close option to close Windows Media Player once the video is done playing. You could try using VLC instead. VLC has a "vlc://quit" command which closes that particular instance once the video is done playing.
  9. I did something similar awhile back and I used AutoIt's native ping and this was what I came up with. Hope it helps. HotKeySet("{ESC}", "Terminate") $ip = InputBox("Ping Type Thing", "IP Address:", "", "", 200, 60) If @Error Then Exit Local $count = 0 Local $success = 0 $display = 'Pinging "' & $ip & '"' SplashTextOn("Ping Type Thing", $display, 650, 45, -1, 5, 48) While 1 $count = $count + 1 $pingresult = Ping($ip, 50) If $pingresult > "0" Then $success = $success + 1 EndIf $percentage = ($success / $count) * 100 $ppacketloss = 100 - $percentage ControlSetText("Ping Type Thing", "", "Static1", $display & ". " & $pingresult & " ms response time and " & Round($ppacketloss, 2) & "% packet loss.") Sleep(50) WEnd SplashOff() Func Terminate() Exit 0 EndFunc
  10. You should be able to use the "wmic printer" command to configure your printer.
  11. I got bored at work so I whipped up a simple script to stream my mp3s from one location to another. Pretty self explanatory. Place script in the same folder as your mp3s. Start up the script, then launch Winamp. From within Winamp, select "Play", "URL". Type in "http://<ip address of machine running the script>:51511" and it should start streaming the mp3. #include <File.au3> #include <Array.au3> TCPStartUp() Local $TCPport = "51511" $msock = TCPListen(@IPAddress1, $TCPport) If $msock = -1 Then MsgBox(0, "Error", "Unable to start server on port " & $TCPport) Exit EndIf $mp3list = _FileListToArray(@ScriptDir, "*.mp3", 1) $i = 0 While 1 $csock = TCPAccept($msock) If $csock <> -1 Then If $i = $mp3list[0] Then $i = 1 Else $i = $i + 1 EndIf TCPSend($csock, "ICY 200 OK" & @CRLF) TCPSend($csock, "icy-name: " & $mp3list[$i] & @CRLF) TrayTip("Simple MP3 Streamer", $mp3list[$i], 10) $open = FileOpen($mp3list[$i], 16) Do $data = FileRead($open, 8) If StringLen($data) = "0" Then Sleep(5000) EndIf $packetsend = TCPSend($csock, $data) If $packetsend = "0" Then ExitLoop Until StringLen($data) = "0" TCPCloseSocket($csock) EndIf WEnd TCPShutdown()
  12. Try RunWait("\\servername\netlogon\" & $username1 & ".bat", "", @SW_HIDE)
  13. Did you try enabling "Allow service to interact with desktop"?
  14. Assuming you know the IP address and the port the server is listening on, try connecting to it with TCPConnect. If you are able to connect to it, then the server is ready to accept connections.
  15. How about performing a series of screen captures, use MEncoder and string them into a video? http://www.mplayerhq.hu/DOCS/HTML/en/menc-...enc-images.html
×
×
  • Create New...