0

I have a usb stick with 2 partitions; one is mounted the other one isn't.

I wish to run a .bat file on the mounted partition which starts another .bat file on the 2nd partiion.

I was using a loop which gets me the drive path of the 2nd partition by searching for volumename. This works fine as long as the 2nd partion has a drive letter, but after removing it I can't find a way to access the data of the 2nd partition.

Is this even possible?

My code so far:

@ECHO off

for /f "skip=1 delims=:" %%A in ('"wmic logicaldisk where
VolumeName='Volume' get DeviceID"') do (
set "drive=%%A:"
goto :break
)

:break
cd /d %drive%
call other.bat

I was thinking about getting the GUID with this loop than access the volume by this ID but searching for code examples only brings me to the above code.

Edit: i am setting up a universal USB drive to manage my passwords, some function as a USB-Key to acess my pc and to manage other private settings. due to using the drive for a cuple of services that should be managed by different usb drives i was trying to create partitions in order get everything running. this will end up in ~4-5 partitions. thats why i was trying to hide all but one which would manage the others.

  • 3
    When you insert the USB drive, why are both partitions not being mounted and allocated drive letters, or why are you dismounting it, then complaining that you cannot access it? Please [edit your question](https://stackoverflow.com/posts/50396839/edit) to provide more information about the task, so that we have a better understanding of the needs and restrictions instead of just the requirements; thank you. – Compo May 17 '18 at 17:40
  • @Compo i added a short description to what i am aiming to do. I know i can easily stay with allocated drive letters, wass still wondering if my problem can be solved the way i asked. – Patryk Preisner May 17 '18 at 18:18
  • So are you really asking if you can hide something from the operating system, but still have access to it through that same operating system? _(You cannot run my car if you do not cannot see it nor have access to it)_. If not please explain better, if so your question is not specific to your code but a general computing question and as such off topic. – Compo May 17 '18 at 18:37
  • i don' t want to hide it from the operating system but from the user. If there is really no possible acess to the disk files without allocating a drive letter to it, my question is also solved. I just thought if you can still see the drive informations like VolumeName and size, there is eventually also a way to access the data on the device. – Patryk Preisner May 17 '18 at 19:14

0 Answers0