Page 1 of 1

Is there a way to make a bootable batch file?

Posted: 11 Jan 2021 08:40
by rasil
Hi,

Recently i made a batch file "operating system" that can connect to the internet, download files, manage files and common desktop apps such as notepad.. but I was thinking about how to make this a bootable iso file so I searched on google and found someone already did it but Microsoft did not like that and closed down their servers it appeared to be windows server 2003 installation that was modified in a way that it had no apps/gui and a batch file that opens up on start up. here is the link to the video: https://www.youtube.com/watch?v=lR3oBCf ... el=LiteSec
Is there way that I can replicate this? with a windows server 2003 iso? i am going for something old because I want it to be lite as possible. At the moment I don't care about drivers and such and just want a bootable batch file.

Rasil

Re: Is there a way to make a bootable batch file?

Posted: 11 Jan 2021 09:16
by jfl
This existed in MS-DOS, and was called AUTOEXEC.BAT:
The first thing MS-DOS did after booting was to automatically run AUTOEXEC.BAT.
Now you can still legally do that using FreeDOS.

Windows is different. It is not an open-source operating system. Its commercial license forbids you to copy it to another system, or to make modifications in the way it works. They rightfully enforce their license, and force to close any web site that distributes unlicensed copies.

If you just need to automate tasks, but don't need a user interface, one possible thing to do is to use Windows PE (A tiny subset of Windows used for Windows installation).
Using it, you can define an XML file that describes what the installation does.
And it's perfectly possible to just make it run cmd.exe and a batch of your choice.
I've done that at work, for doing special installations that required some hardware tinkering before the real installation could begin.
But be aware that this is extremely difficult to debug, as you're completely in the blind in the first phases. (Which is why I eventually developed a very complex batch debugging library.) Unless you have a real business need, and a lot of time to waste, it's probably not a good idea.

It's probably not politically correct to say this on this forum, but you'd be better off using Linux instead!

Re: Is there a way to make a bootable batch file?

Posted: 11 Jan 2021 09:43
by kwsiebert
I'm not sure if this is still possible with Windows 10, but in earlier versions you could change the 'shell' program, the main one that was launched as the GUI. By default, it's explorer.exe, but you could change it to cmd.exe to only get a command line, or to any specific program/batch file of your choice. The underlying Windows operating system and drivers will still load, which is important for batch files, only your default interface program changes. Use Google to find instructions to change the shell on your specific version of Windows, but be very careful (and have a backup) because doing this wrong can easily leave the system unusable.

Re: Is there a way to make a bootable batch file?

Posted: 11 Jan 2021 10:03
by rasil
jfl wrote:
11 Jan 2021 09:16
This existed in MS-DOS, and was called AUTOEXEC.BAT:
The first thing MS-DOS did after booting was to automatically run AUTOEXEC.BAT.
Now you can still legally do that using FreeDOS.

Windows is different. It is not an open-source operating system. Its commercial license forbids you to copy it to another system, or to make modifications in the way it works. They rightfully enforce their license, and force to close any web site that distributes unlicensed copies.

If you just need to automate tasks, but don't need a user interface, one possible thing to do is to use Windows PE (A tiny subset of Windows used for Windows installation).
Using it, you can define an XML file that describes what the installation does.
And it's perfectly possible to just make it run cmd.exe and a batch of your choice.
I've done that at work, for doing special installations that required some hardware tinkering before the real installation could begin.
But be aware that this is extremely difficult to debug, as you're completely in the blind in the first phases. (Which is why I eventually developed a very complex batch debugging library.) Unless you have a real business need, and a lot of time to waste, it's probably not a good idea.

It's probably not politically correct to say this on this forum, but you'd be better off using Linux instead!
I like the MS-DOS method but later on there's no way to get any sorts of drivers on to it plus I would assume that the batch version would be pretty old and may not run the batch file as I would like it to.
Linux would be the batter method but I have no idea how to run batch files at start-up with wine and make the whole package a live iso. I searched on google and couldn't find a single thread on this topic but it seems as though that debian has the most drivers made for it for wifi and such. All I would want is a live debian iso and a folder within it that I can place my batch file(s) in and it would run the batch file (full screen) on start-up. Sorry for my un-technical language as I am just doing this as a challenge to see if I can build a os!

Rasil

Re: Is there a way to make a bootable batch file?

Posted: 17 Jan 2021 11:54
by isidroco
A Batch is not an OS. You can try using Hiren's Boot CD mini XP. Any batch file can be placed on StartUp menu folder and will be launched at startup.

Re: Is there a way to make a bootable batch file?

Posted: 17 Jan 2021 17:36
by ShadowThief
rasil wrote:
11 Jan 2021 10:03
I am just doing this as a challenge to see if I can build a os!
You certainly can, just not by using a language that requires an existing operating system to function. Real operating systems are written in C and assembly. https://wiki.osdev.org/Getting_Started