Hi,
I'm completely new to writing batch scripts. I'd like my script to run netcat and then send a few commands, but when I run it, the script stops and waits for netcat to exit.
Is there a way to write commands when the netcat promt comes up? This is what I have done so far:
:: WP.bat
:: Runs WordPerfect
::
::@ECHO OFF
C:
nc -u 192.168.xxx.xx 60000
set_transport_type:tcp
^C
After the " nc -u 192.168.xxx.xx 60000 " command netcat prompts and is ready for commands, but the "set_transport_type:tcp" is never run.
Thank you for your time
Giving more commands when a program has been executed
Moderator: DosItHelp
-
- Posts: 2
- Joined: 16 Feb 2012 02:15
Re: Giving more commands when a program has been executed
You want these command executed inside netcat, not the command line, right?
That's not a batch file issue but a script issue for netcat, if netcat accepts script files.
That's not a batch file issue but a script issue for netcat, if netcat accepts script files.
-
- Posts: 2
- Joined: 16 Feb 2012 02:15
Re: Giving more commands when a program has been executed
Thank you your answer.
Yes, I would like it to execute these commands inside netcat, but it still runs in the cmd window?
So there is no easy way around this?
Yes, I would like it to execute these commands inside netcat, but it still runs in the cmd window?
So there is no easy way around this?
Re: Giving more commands when a program has been executed
Look at the help for netcat to see how to use a script file or provide a URL to the version you are using, so one of us can have a look.
Re: Giving more commands when a program has been executed
You may try this:
Code: Select all
C:
(
echo set_transport_type:tcp
echo ^C
) | nc -u 192.168.xxx.xx 60000