Answer the question
In order to leave comments, you need to log in
How to send a shutdown command to netcat?
Based on yesterday's article on Habré We fasten multimedia keys in Yandex.Radio automated the process using netcat for windows .
In principle, everything worked, but the window cmd
does not close automatically, tell me how this can be solved?
start-pause.bat
type start-pause.txt | cmd /c "D:\Soft\netcat-win32-1.12\nc.exe" -v localhost 32000
(function(f){f.player.pause() || f.player.resume() || f.play()})(Mu.pages.player.flow);
taskkill /im nc.exe /f
start "" "D:\Soft\netcat-win32-1.12\nc.exe" ...
Answer the question
In order to leave comments, you need to log in
Like an experiment. Can this powershell script do what you want without using netcat?
sendtcpdata.ps1 text
$Message = '(function(f){f.player.pause() || f.player.resume() || f.play()})(Mu.pages.player.flow);'
$socket = new-object System.Net.Sockets.TcpClient("localhost", 32000)
$data = [System.Text.Encoding]::ASCII.GetBytes($message)
$stream = $socket.GetStream()
$stream.Write($data, 0, $data.Length)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question