cmd - Cannot edit registry via BAT file but command-line works fine -
so strange thing happend today. writing *.bat edits registry values. example, let's command this:
@echo on reg add "hkey_current_user\software\microsoft\windows\currentversion\policies\explorer" /v "nopreviewpane" /t reg_dword /d "2" /f pause
if type (paste) elevated cmd, works should. if create *.bat file command , run it: - run administrator: cmd opens , closes, , nothing happens - run normally: "access denied" - ok, because editing cmd requires admin rights, afaik.
any ideas wrong?
the hkey_current_user
changes when current user changes (i.e. administrator).
you need make script write relevant sub-key of hkey_current_users
instead - note s @ end. (see here bit more on this.)
Comments
Post a Comment