batch for if else to check regedit
Posted: 19 Oct 2009 00:49
hi,
Disable Regedit
REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableRegistryTools /t REG_DWORD /d 1 /f
Enable Regedit
REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableRegistryTools /t REG_DWORD /d 0 /f
I want to create batch file as below:
[1] Run Regedit
My pc was restrict to run regedit unless i enable it back at registry via REG command. I want to do like this:
once user choose [1], batch will check the value of existing registry of user pc. if the existing value is 1, then batch will change value to 0..then it will call the regedit program. after user finished with regedit and close it, the batch will automatically change the value to 1
but when user choose [1], batch check the existing registry of user pc if the existing value is 0, the value will still remain then batch will call the regedit program. after user finished with regedit and close it, batch will close the regedit itself.
simple wors:
if user pc is registry disable, the option [1] will temporary make it enable until user finished used it and it when change ti disable mode again.
if user pc is registry enable, nothing will be change
help me how to code this...
Disable Regedit
REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableRegistryTools /t REG_DWORD /d 1 /f
Enable Regedit
REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableRegistryTools /t REG_DWORD /d 0 /f
I want to create batch file as below:
[1] Run Regedit
My pc was restrict to run regedit unless i enable it back at registry via REG command. I want to do like this:
once user choose [1], batch will check the value of existing registry of user pc. if the existing value is 1, then batch will change value to 0..then it will call the regedit program. after user finished with regedit and close it, the batch will automatically change the value to 1
but when user choose [1], batch check the existing registry of user pc if the existing value is 0, the value will still remain then batch will call the regedit program. after user finished with regedit and close it, batch will close the regedit itself.
simple wors:
if user pc is registry disable, the option [1] will temporary make it enable until user finished used it and it when change ti disable mode again.
if user pc is registry enable, nothing will be change
help me how to code this...