File replacing bat/sh file!

Hello, everyone!

I have a rather interesting problem. I’m trying to create a self-updating launcher, but I am having some problems, especially on Windows. Windows won’t let me modify any file in any way, so it seems like I’ll need native code for that. The simplest way would be to have the launcher download all updated files with the file extension “.new” added and then execute a small script that scans through the directory and overwrites all old files with their new version. That allows the JVM to unload all files that it used and the script can update everything without any problems. The problem is writing said scripts as I have limited experience with .bat scripts and pretty much no experience with .sh scripts. >___<

I’m currently looking into how to do this with a .bat script, but I will most definitely need help with the .sh version. It’d be great if someone could help me out with it! Help with the .bat file would also be much appreciated!