sorry for not stating this clearly. what i'm doing (after a clean install of windows) is searching for a certain file on harddrives (right now the file Default.rdp, because its more or less common on the computers i'm taking care of) and setting the registry value of HKCU\Software\Microsoft\Windows\Currentversion\Explorer\Shell Folders to that path (i want to change from the Default.rdp file to a certain folder (i.e. Documents), though this is on progress right now). afterwards i want to overwrite the My Music setting in the registry with the same path (just add \My Music), the same with the My Pictures folder,... so right now i do: 1) the %mydocs% value i get from here: FOR /F "tokens=3" %%B IN ('ECHO list volume ^| DISKPART.EXE ^| FIND.EXE "Partition"') DO if exist "%%B:\Documents\Default.rdp" SET mydocs=%%B:\Documents im searching also certain paths containing whitespaces - so if i do a SET mydocs="%%B" i end up with a path (stored as the variable %mydocs%) looking like "E:\User Files\Documents". if i attach a \My Music" to it i end up with "E:\User Files\Documents"\My Music". you see the problem? its not a typo (the quote before the \My). afterwards i want to 2) write the according path of the My Music folder to the registry: reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Music" /t REG_SZ /d "%mydocs%\My Music" /f so IF i can do a search for a folder (to clearify: i think the right term would be i need a recursive folder search) some day AND write the path of this folder to the registry (including whitespaces, Music, etc) i would be glad :-)