Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > How to automatically enter commands in cmd

Reply
Thread Tools Display Modes

How to automatically enter commands in cmd

 
 
Ghost_Recoil
Guest
Posts: n/a

 
      01-22-2009

Hell

When I want to enter some commands I would go to start -> cmd -> telne
10.1.1.
type my username and password, and then start copying and pasting th
commands in cmd. Pretty tedious sometimes

I was wondering if I can create a .bat file or some kind of script fo
windows to automaticallyrun the following commands in cmd for me

Thanks!

> telnet 10.1.1.
> User: admi
> Password: admi
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.2 -p tc
> --dport 6122 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.2 -p tc
> --dport 6132 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.2 -p tc
> --dport 6142 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.2 -p tc
> --dport 6152 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.3 -p tc
> --dport 6112 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.3 -p tc
> --dport 6132 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.3 -p tc
> --dport 6142 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.3 -p tc
> --dport 6152 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.8 -p tc
> --dport 6112 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.8 -p tc
> --dport 6122 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.8 -p tc
> --dport 6142 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.8 -p tc
> --dport 6152 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.7 -p tc
> --dport 6112 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.7 -p tc
> --dport 6122 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.7 -p tc
> --dport 6132 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.7 -p tc
> --dport 6152 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.6 -p tc
> --dport 6112 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.6 -p tc
> --dport 6122 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.6 -p tc
> --dport 6132 -j DNAT --to 10.1.1.
> iptables -t nat -A PREROUTING -d 124.180.104.125 -s 10.1.1.6 -p tc
> --dport 6142 -j DNAT --to 10.1.1.
>
> iptables -t nat -A POSTROUTING -d 10.1.1.2 -s 10.1.1.3 -p tcp --dpor
> 6112 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.2 -s 10.1.1.8 -p tcp --dpor
> 6112 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.2 -s 10.1.1.7 -p tcp --dpor
> 6112 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.2 -s 10.1.1.6 -p tcp --dpor
> 6112 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.3 -s 10.1.1.2 -p tcp --dpor
> 6122 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.3 -s 10.1.1.8 -p tcp --dpor
> 6122 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.3 -s 10.1.1.7 -p tcp --dpor
> 6122 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.3 -s 10.1.1.6 -p tcp --dpor
> 6122 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.8 -s 10.1.1.2 -p tcp --dpor
> 6132 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.8 -s 10.1.1.3 -p tcp --dpor
> 6132 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.8 -s 10.1.1.7 -p tcp --dpor
> 6132 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.8 -s 10.1.1.6 -p tcp --dpor
> 6132 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.7 -s 10.1.1.2 -p tcp --dpor
> 6142 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.7 -s 10.1.1.3 -p tcp --dpor
> 6142 -j SNAT --to 124.180.104.12
> iptables -t nat -A POSTROUTING -d 10.1.1.7 -s 10.1.1.8 -p tcp --dpor
> 6142 -j SNAT --to 124.180.104.125
> iptables -t nat -A POSTROUTING -d 10.1.1.7 -s 10.1.1.6 -p tcp --dport
> 6142 -j SNAT --to 124.180.104.125
> iptables -t nat -A POSTROUTING -d 10.1.1.6 -s 10.1.1.2 -p tcp --dport
> 6152 -j SNAT --to 124.180.104.125
> iptables -t nat -A POSTROUTING -d 10.1.1.6 -s 10.1.1.3 -p tcp --dport
> 6152 -j SNAT --to 124.180.104.125
> iptables -t nat -A POSTROUTING -d 10.1.1.6 -s 10.1.1.8 -p tcp --dport
> 6152 -j SNAT --to 124.180.104.125
> iptables -t nat -A POSTROUTING -d 10.1.1.6 -s 10.1.1.7 -p tcp --dport
> 6152 -j SNAT --to 124.180.104.125
> exit
>



--
Ghost_Recoil
Posted via http://www.vistaheads.com

 
Reply With Quote
 
 
 
 
Ghost_Recoil
Guest
Posts: n/a

 
      01-26-2009

help!!!!!!!!!!!!!!!!!!!!!!!!!!!


--
Ghost_Recoil
Posted via http://www.vistaheads.com

 
Reply With Quote
 
Dave
Guest
Posts: n/a

 
      01-26-2009
What do you mean?
Explain...........................................


--
Windows 7 beta
http://get.live.com/wlmail/overview
http://download.live.com/wlmail


"Ghost_Recoil" <> wrote in
message news:...
>
> help!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
>
> --
> Ghost_Recoil
> Posted via http://www.vistaheads.com
>

 
Reply With Quote
 
Ghost_Recoil
Guest
Posts: n/a

 
      01-26-2009

Ok I edited my initial post, I hope it makes more sense now

Thanks

--
Ghost_Recoi
Posted via http://www.vistaheads.co

 
Reply With Quote
 
Gene E. Bloch
Guest
Posts: n/a

 
      01-26-2009
It happens that Ghost_Recoil formulated :
> Hello


> When I want to enter some commands I would go to start -> cmd -> telnet
> 10.1.1.1
> type my username and password, and then start copying and pasting the
> commands in cmd. Pretty tedious sometimes.


> I was wondering if I can create a .bat file or some kind of script for
> windows to automaticallyrun the following commands in cmd for me.


> Thanks!!


<SNIP>

>> exit


Consider putting the set of commands into a text file, say tnet.txt,
then run this:

telnet < tnet.txt

Two provisos:
You must put an exit command in the file! Otherwise you'll be trapped
inn telnet... That's why I didn't snip the exit line when I snipped ;-)

You'll also have to put your login name and password at the start of
the file.

There should be one major caveat: I'm not 100% sure it'll work :-(

--
Gene E. Bloch letters0x40blochg0x2Ecom


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keystroke commands SunnyAZ Windows Vista General Discussion 1 03-25-2008 11:28 PM
Commands JMed Windows Vista General Discussion 5 01-08-2008 12:50 PM
DOS commands PJ Perillo Windows Vista General Discussion 5 12-18-2007 07:31 PM
Automatically "Automatically get new IP settings for the network adapter" Hexaphim Windows Vista Networking 0 08-03-2007 07:46 PM
Vista Ultimate x64 Will Not Enter Sleep Mode but will Enter Hibern reductant Windows Vista General Discussion 4 05-07-2007 09:41 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59