I have asked other questions about Concatenated commands in DOS, but am obviously not yet that confident with the full bredth of things to take into account.
Can someone take a look at the below code and output on my system and see if they can advise what syntax is wrong (Note, I have broken the lines manually):
%comspec% /v:on /k "(for /f "tokens=2*" %a in ('reg query hkcu\software\microsoft
\windows\currentversion\policies\system /v DisableTaskMgr') do @set DisableTaskMg
r=%b) 2>nul & set DisableTaskMgr& pause & (if defined programfiles^(x86^) (set
"ProgramFiles(x32)=%programfiles(x86)%") else (set "ProgramFiles(x32)=%programfil
es%")) & !ProgramFiles(x32)!\Mozilla\Firefox\Firefox.exe -chrome chrome://browser
/content & echo. & if defined DisableTaskMgr (echo DisableTaskMgr reg key existed
prior to running, and... & (set DisableTaskMgr=%DisableTaskMgr:~2,3% & echo !
DisableTaskMgr! & reg add hkcu\software\microsoft\windows\currentversion\policies
\system /v DisableTaskMgr /t REG_DWORD /d %DisableTaskMgr% & if %DisableTaskMgr%
eql 0 (echo Previous state was Task Manager enabled) else (echo Previous state
was Task Manager DISabled))) else (echo DisableTaskMgr reg key DID NOT exist pri
or to running & reg delete hkcu\software\microsoft\windows\currentversion\polici
es\system /v DisableTaskMgr /f)"
.
I have tried cutting out parts of the code to fix individual parts, but my attempts at trial and error prove that I don't have much of an idea of what is wrong, and that I am not going to get this solved on my own very fast :(