hello, and welcome. today im gonna teach you guys how to create and new hard disk on your own computer, using a Batch File. so let start.
Step by Step :
1. Open a new Notepad.
2. Write in this code :
Code:
@echo off
diskw
IF NOT ERRORLEVEL 1 goto started
set Disk=%1
IF "%Disk%"=="" set Disk=Z
rem create the disk
subst %Disk%: "Hard Disk"
IF ERRORLEVEL 1 goto hint
set closeit=%programit%close.bat %Disk%
%Disk%:
CLS
echo The server is working on the disk %Disk%:\
goto end
:hint
CLS
echo The disk %Disk% is busy. Use stop.bat [disk letter]
goto pause
:started
CLS
echo ERROR!!!
echo The %Disk% is busy. Use stop.bat
:pause
echo .
pause
:end
exit
Now notice that i wrote the "Z" with red. Its becours now i wrote Z there, so when i use this batch will create a new Hard Disk called "The hard disk the batch file is in"(Z:\). you can also change this to f-g-h or any word u like then it was change the word (Z:\) to what u choose but u cant name the Hard Disk. it will have the name of the Hard Disk this batch file is located in.
4. Press "File -> Save As" Save it as "Start Disk.bat" then it will be a batch file
5. now open a new notepad and write this :
Code:
@echo off
IF "%Disk%"=="" set Disk=Z
subst "%Disk%": /D
That was a pretty small code. it stops the hard disk from running. in other word, it remove the Disk from "My Computer" and if u now use the "Start Disk.bat" then it will come into My Computer again. Also notice that the "Z" in this file, the stop file is red. its becourse if u change the Z in the start file then u have to change it in this file too, or else this one wont be able to put it off.
6. Now press "File -> Save As" and save the same location as the other file.
7. Now create a folder called "Hard Disk" and place at the same location as "Start Disk.bat" and "Stop Disk.bat" this is the "Disk" if u put anything into this folder, then it will be shown in the Hard Disk.
I hope u liked this tutorial, bye and cya another day.
Enjoy