c:\test>perl -de1 Loading DB routines from perl5db.pl version 1.3 Editor support available. Enter h or `h h' for help, or `perldoc perldebug' for more help. main::(-e:1): 1 DB<1> $x = 12345 DB<2> print $x 12345 DB<3> #### C:\test>path PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\T... C:\test>cmd /c "set path=a load of junk here && path" PATH=a load of junk here C:\test>path PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\T... #### C:\test>type junk.bat set test=this is the value set inside the .bat file c:\test>start /b junk.bat c:\test>set test=this is the value set inside the .bat file c:\test>set test Environment variable test not defined #### c:\test>type junk.bat set test1=this persists setlocal set test2=this does not persist endlocal set test3=and this persists also c:\test>set | find "test" c:\test>junk c:\test>set test1=this persists c:\test>setlocal c:\test>set test2=this does not persist c:\test>endlocal c:\test>set test3=and this persists also c:\test>set | find "test" test1=this persists test3=and this persists also