I have these 3 files in a folder and they are all located in C:\Max
:
attach.bat:
@echo off
cd %~dp0
diskpart /s run.txt
run.txt:
select vdisk file="C:\Max\maximus.vhd"
attach vdisk
maximus.vhd: a virtual hard disk drive which is mounted via the other 2 files.
How can attach.bat get the current directory location and write it to run.txt?
I know how to write to the txt files, but I can't find the current directory. I want to be able to mount this from anywhere on the fly and any directory.
For example:
echo select vdisk file="C:\Max\maximus.vhd" >> C:\Max\run.txt
echo attach vdisk >> C:\Max\run.txt