Page 1 of 1

Access is denied.: how to modify APPDATA file?

Posted: 05 Aug 2012 12:09
by tinfanide

Code: Select all

ECHO.>%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Themes\slideshow.ini


I would like to use batch scripts to modify the slideshow.ini file. Yet it returns:

Access is denied.


It's okay, though, to read the file with

Code: Select all

notepad.exe %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Themes\slideshow.ini

Re: Access is denied.: how to modify APPDATA file?

Posted: 05 Aug 2012 12:15
by foxidrive
cacls.exe can modify the permissions in a batch file.

You may need to change the permissions for the folder or branch as well as the file.

Re: Access is denied.: how to modify APPDATA file?

Posted: 05 Aug 2012 12:25
by tinfanide
Just found why the message was shown.

Code: Select all


ATTRIB -H %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Themes\slideshow.ini
ECHO.>%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Themes\slideshow.ini
ATTRIB +H %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Themes\slideshow.ini


After realising the file is hidden (just a sudden thought), it'd be easy to fix it.
Just realise hidden files are protected from being modified.

Haven't tried your suggestion.
But learnt a new thing from you.
Lovely.
Thanks.