Guest jl7c2 Posted July 23, 2003 Share Posted July 23, 2003 I have to make a batch file for Windows XP to set the IPv6 address and default route for an ethernet card. This batch file should be loaded at every startup. It looks like this: ipv6 rtu 2002::/16 4 ipv6 adu 4/3ffe:bc0:174:1::2 ipv6 rtu ::/0 4/3ffe:bc0:174:1::1 pub life 1800 The problem is that when the batch file containing these lines is executed, it just executes the first line infinitly and I have to click the X to close it. I can manually type them in without any loops or problems. Is there just a problem with my batch file? Are there any IPv6 pimpz :cool: who know that it isn't the batch file, rather just the first line? Thanks for the help. Link to comment https://www.neowin.net/forum/topic/93787-infinite-loop-in-bat-file/ Share on other sites More sharing options...
John Veteran Posted July 23, 2003 Veteran Share Posted July 23, 2003 the first line runs fine for me, but i don't know what it does :s i noticed that "rtu" isn't listed in the list of switches/parameters for the ipv6 command, maybe that's you're problem? :huh: what's it supposed to do? Link to comment https://www.neowin.net/forum/topic/93787-infinite-loop-in-bat-file/#findComment-1070290 Share on other sites More sharing options...
Guest jl7c2 Posted July 23, 2003 Share Posted July 23, 2003 It is supposed to route all IPv6 addresses in the 2002::/16 prefix to network interface 4. It is just a part of the process of setting up IPv6 on Windows XP. rtu is a supported ipv6 switch and it does what it is supposed to do when I type it into the command prompt manually. It is just with the batch file that I have problems. Go figure, I can make UNIX sh or bash scripts, but I can't do a simple DOS batch script. :blush: Link to comment https://www.neowin.net/forum/topic/93787-infinite-loop-in-bat-file/#findComment-1070301 Share on other sites More sharing options...
John Veteran Posted July 23, 2003 Veteran Share Posted July 23, 2003 :laugh: i know how you feel, i forget the simpler stuff sometimes too (take algebra for instance :blush: ) but i thought "ipv6 install" did all the work of setting up ipv6 on xp? :blink: Link to comment https://www.neowin.net/forum/topic/93787-infinite-loop-in-bat-file/#findComment-1070341 Share on other sites More sharing options...
Guest jl7c2 Posted July 23, 2003 Share Posted July 23, 2003 "ipv6 install" just lets you use IPv6. You still have to configure the IPs and those IPs get erased every time you reboot, so you have to use a script to reset it, much like all networking in Linux. Right now I am using radvd on my Linux box to set the IPs on all the other boxes dynamically, but it sets a really long IP like: 3ffe:0bc0:0174:0001:0be1:112c:5c92:12ed and it gets on my nerves. I like the shorter 3ffe:bc0:174:1::2, which I have to set manually, but that is besides the point. My point is that my batch file is crappy so I need the smart people on Neowin to help me fix it. :) Do I need something like a semicolon at the end of everyline or maybe some command like STOP or EXIT or END at the end. Am I forgetting something at the beginning like START or BEGIN? (Or at least tell me its a bug so I can get on with my life...man I hate Windows.) Link to comment https://www.neowin.net/forum/topic/93787-infinite-loop-in-bat-file/#findComment-1070360 Share on other sites More sharing options...
John Veteran Posted July 23, 2003 Veteran Share Posted July 23, 2003 i'm gonna have to get used to these new IPs :wacko: you don't need semicolons, STOP, EXIT, or END codes or anything (though you can use a cls at the end with no line return) who knows, it may be a bug. the ipv6 standard isn't even finished yet is it? and i think microsoft's implementation of it is beta, included in xp only for developers. IMO they should have made it a separate download, but who am i to tell them what to do? ;) Link to comment https://www.neowin.net/forum/topic/93787-infinite-loop-in-bat-file/#findComment-1070432 Share on other sites More sharing options...
wprigjoigj3i40jhgi0435ejh Veteran Posted July 23, 2003 Veteran Share Posted July 23, 2003 if "ipv6" is a .com or .exe file it will execute and not return for further instruction. i think this is your problem. try using the call command to call the ipv6 program outside of the batch file. if you dont know how to use it google it up. :) cheers and good luck. Link to comment https://www.neowin.net/forum/topic/93787-infinite-loop-in-bat-file/#findComment-1070469 Share on other sites More sharing options...
wprigjoigj3i40jhgi0435ejh Veteran Posted July 23, 2003 Veteran Share Posted July 23, 2003 p.s. a better solution, but more in depth, might be to create 4 batch files. download the dos sleep application. First bat file: ipv6 rtu 2002::/16 4 exit Second bat file: sleep 15 ipv6 adu 4/3ffe:bc0:174:1::2 exit Third bat file: sleep 30 ipv6 rtu ::/0 4/3ffe:bc0:174:1::1 pub life 1800 exit fourth bat file call first.bat call second.bat call third.bat exit Link to comment https://www.neowin.net/forum/topic/93787-infinite-loop-in-bat-file/#findComment-1070480 Share on other sites More sharing options...
MrStaticVoid Posted July 29, 2003 Share Posted July 29, 2003 I used to be jl7c2 but changed my name. Sorry I have been very busy lately and haven't fooled around on my Windows XP :x computer. I just realized that my problem though. My file name was ipv6.bat. So when the line in the batch file called ipv6 rtu...it was calling ipv6.bat, which called it self again and again creating an infinite loop. Jeez I am so ebarassed that I didn't think about that. Now for more Windows bashing...<bash>UNIX sh scripts would never do that! Windows sucks!</bash> I'm only kidding. LOL. Thanks for all your help though! :) Link to comment https://www.neowin.net/forum/topic/93787-infinite-loop-in-bat-file/#findComment-1085607 Share on other sites More sharing options...
Know Won Posted July 29, 2003 Share Posted July 29, 2003 :: is command seperator. You can execute multiple commands in a single line using :: like dir /s::dir /s as a result ipv6 rtu 2002 & /16 4 are considered as two seperate comands So the solution is to use the expanded form of IPV6 address. Link to comment https://www.neowin.net/forum/topic/93787-infinite-loop-in-bat-file/#findComment-1085643 Share on other sites More sharing options...
MrStaticVoid Posted July 29, 2003 Share Posted July 29, 2003 Hmm...I don't seem to be having any problems with using the condensed form of the IPv6 address. My original batch file works just fine, now that I am using the full path to ipv6.exe, but the :: separator is nice to know about. Link to comment https://www.neowin.net/forum/topic/93787-infinite-loop-in-bat-file/#findComment-1085906 Share on other sites More sharing options...
Know Won Posted July 29, 2003 Share Posted July 29, 2003 OK. Stupid me. I was thinking about && (which is the correct command seperator) disregard my post. Link to comment https://www.neowin.net/forum/topic/93787-infinite-loop-in-bat-file/#findComment-1086173 Share on other sites More sharing options...
Recommended Posts