I am trying to write a batch file to run through a list of domains and then use each on as a variable and then run a reg export on these like below:-
for /f "delims=" %%x in (domains.txt) do set Domain=%%x
GOTO :ExportReg
:ExportReg
reg export HKEY_LOCAL_MACHINE\SOFTWARE\Ipswitch\IMail\Domains\%Domain% C:\export-%Domain%.txt
echo %%Domain%%
:End
but this just tries to output it all to the same file, causing overwrite errors
so it outputs as c:\export-domain.com.txt then the next one is say domain.co.uk but it tries to write it to domain.com.txt again.