Infinite loop in .bat file


Recommended Posts

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

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:

"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.)

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? ;)

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.

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

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! :)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I have tried that registry 'trick' from that video already. It doesn't work at all in Win11 for me   Yes it's a 3rd party app... that I am only using because of Microsoft breaking user customization in Windows 11. So yes... the is a Windows 11 issue. As of now to me, Microsoft has made a huge mistake with this in Windows 11.   The current font option in Windows 11 are terrible. They are just missing. People that want to use their own computer the way they want to, they need to avoid 11.
    • It's been an age since I did desktop support, but here goes: You have an issue with Windows 11, which is fair.  You are using a freeware 3rd party app to make modifications to the default Windows 11.  Since an update, this 3rd party application no longer plays nice with Windows 11.  And this is somehow Windows 11's fault? Sorry, not buying that this is a Windows 11 problem... it's a customization issue that has just appeared, but standard 3rd party support.   Clearly you're upset.  You can't make Windows do anything, just like you can't make MacOS run Explorer or Linux run Nintendo games natively.  And I know people are going to say "sure, it's possible..." but those aren't defining elements of the OS.  You can't have animated backgrounds in Windows 11 natively -- so it's trash amirite??? I did quick searches about changing the default fonts and there are ways to do it, and clearly 3rd party freeware apps can do it (basically my guess is they're making registry changes on your behalf) and clearly they're having issue.   You can make your computer do a lot of things, but sometimes you get what you pay for. Did a quick search and don't see an easy option in Windows 10 either.  Some of these links - ironically - are for Windows 10.  They still apply. Here's a video tutorial of how it can be done without a 3rd party:   Same reference here with a bit more detail: https://www.howtogeek.com/716407/how-to-change-the-default-system-font-on-windows-10/ Once the font is chosen, the size can be changed via personalization from my understanding. Hope this helps.
    • Videomass 5.0.26 by Razvan Serea Videomass is not just a common converter, it features file concatenation, time trimmer, ability to create thumbnails, tiled mosaics and animated giffs from movies; it has sophisticated GUIs for video filters, previews for video stabilization, resizing, croping, transposing, color equalization. It features PEAK, RMS and EBU audio normalization with streams indexing capabilities, a volume analyzer, audio preview and many more interesting features… For the people that are familiar with FFmpeg, it has a highly customizable preset manager with the possibility to easily make your own presets through the GUI and adapt this to your specific needs or create new presets using the FFmpeg command line. For less experienced people there are also ready-to-use presets. It offers out-of-the-box all possible file formats like MP4, M4V, M4A, MKV, AVI, OGV, WEBM, MP3, AC-3, WAV, OPUS, FLAC, OGG and encoders like MPEG-4, H.264/AVC, H.265/HEVC, VP8, VP9, LIBAOM-AVI, VORBIS, PCM, LAME, ALAC, etc. Also you can copy audio or video streams (lossless mode) without re-encoding, or extract audio from videos and much more! Main features No ads Multi-Platform, work on Linux, MacOs, Windows, FreeBsd. Batch processing. Queue management (only available for Presets Manager and A/V Conversions). Advanced log file management. Multi-panels, switch between panels using keyboard shortcuts. Audio/video processing using advanced tools and sophisticated filters interfaces. While downloading audio or video you can now do other transcoding tasks. Multi languages support (English, French, Italian, Russian, Dutch, Portuguese-BR, simplified Chinese, Spanish-ES, Spanish-CU, Spanish-MX) Conversions and transcoding Drag and drop to add multiple files simultaneously. Fully customizable presets and profiles. Possibility to create your new presets and profiles from scratch. Has useful presets to start with. Using the Presets Manager, you can set any format and codec supported by your FFmpeg build. Media file info (from FFprobe) and streams analyzer (from volumedetect). Shows the estimated time of arrival during encodings. Concatenate, merge media files losslessly. Create Slideshows. Extract images from video. Ability to switch between different FFmpeg builds. Has useful graphical tools for evaluating the supported features of a specific FFmpeg build. Audio stream mapping using selectable indexes. You can set both audio and video to copy when you just want to convert formats (lossless process). Timeline editor to slice time segments or trim the duration of your media even without re-encoding and therefore without loss of quality. It has GUI video filters such as: Resize Crop Transpose Deinterlace Denoise Stabilize Equalize Audio filters for volume normalization such us: PEAK, RMS and EBU-R128 normalizers. PEAK and RMS volume analysis reporting. Ability to select specified audio streams in videos to apply volume normalization. and much more… Videomass 5.0.26 changelog: Fixed yt-dlp preferences tab issue #372 Enabled import of the external «yt_dlp» package also on the standalone executable built by Pyinstaller. Improved handling of the yt-dlp executable (yt-dlp.exe on Windows) which now provides some automation and useful information for the users. Added «Whale» browser to the supported browser list for cookie automations. Update it_IT i18n, thanks to @bovirus Update zh_CN i18n, thanks to @userwljs Removed API functionality for download operations. Now only the yt-dlp executable is used for download operations. The API is still needed and will only be used for statistics extraction and format code listing. Fixed #374 Added «FLAC resampler» new preset. Notes: FFmpeg is not included in this archive. Before launching the application, ensure you have a compatible version of FFmpeg for your system architecture (requires ffmpeg.exe, ffprobe.exe, and ffplay.exe, version 5.1 or newer). For more details and downloads, visit: Gyan's FFmpeg builds page BtbN's FFmpeg GitHub releases page Antivirus False Positive Detection Some antivirus programs may mistakenly flag Videomass.exe as malicious. These are false positives. To resolve this, submit the Videomass.exe file to your antivirus vendor for further analysis and request a false positive review. Download: Videomass 5.0.26 | 18.4 MB (Open Source) Links: Videomass Home Page | Screenshots | Other OSes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • Week One Done
      abortretryfail earned a badge
      Week One Done
    • First Post
      Mr bot earned a badge
      First Post
    • First Post
      Bkl211 earned a badge
      First Post
    • One Year In
      Mido gaber earned a badge
      One Year In
    • One Year In
      Vladimir Migunov earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      489
    2. 2
      +FloatingFatMan
      261
    3. 3
      snowy owl
      244
    4. 4
      ATLien_0
      222
    5. 5
      Edouard
      189
  • Tell a friend

    Love Neowin? Tell a friend!