by Herb » 17 Mar 2010, 14:45
Gut dann wirds eben etwas komplizierter.
Switching to english for others may use this as well.
Generate a batchfile with the following content:
:: Prerequisites:
:: Generate with Notepad a line which reads without quotes and no return at the end 'set lspace='
:: Save it as set1.txt in the root directory
::
:: Generate with Notepad a line which reads without quotes and no return at the end 'set '
:: don't forget the blank at the end and save it as set2.txt in the root directory
::
:: You may now start this batch from a space of your choice
::
:: Go down to drive level
cd\
:: Searching the ini location
dir /b/s teamdrive.ini >ini.txt
:: Creating the SET batchfile
copy set1.txt /b + ini.txt /b set.bat
:: Creating environment variable lspace
call set.bat
:: Looking up Spaces Address
findstr "defaultSpacesFolder" %lspace% > spaces.txt
: Creating the SET batchfile
copy set2.txt /b + spaces.txt /b set.bat
:: Creating environment variable 'defaultSpacesFolder'
call set.bat
:: Cleanup
del ini.txt
del spaces.txt
del set1.txt
del set2.txt
del set.bat
:: Change to spaces folder
cd %defaultSpacesFolder%
:: Now add any command for file manipulation using the last variable