misol101 wrote:Another little speedup trick is to clear out all or almost all unused environment variables. I found that all my scripts got a 5-10% speedup by doing this. I found this trick in a script by einstein1969. Just remember to call setlocal first, otherwise the variables are deleted from your actual cmd envioronment.Code: Select all
setlocal
for /F "tokens=1 delims==" %%v in ('set') do set "%%v="
...
endlocal
@misol101, cool, I didn't know about this syntax of set. But just assume what will happen if I don't use setlocal? Will all the variables like %PATH% Will still be blank after restarting cmd or situation would return to normal?