I had to reinstall vista once and so vista copied its already existing files into Windows.old like any other decent OS does. This was of course a move to help me keep the data I already had in C drive at that time.
Now that my work with it was done, I couldn’t delete it. UAC was constantly telling me I didn’t have the rights to do so. The sad part is that I am the administrator and those files aren’t of any use to me. I tried switching off UAC but that requires a reboot so I started searching for alternatives since Vista wouldn’t let me edit the rights directly either.
Thanks to Rotem for linking me to Tim Sneath’s MSDN blog which explains a method to reset rights over a folder.
The problem quite clearly is that Vista doesn’t remember which group holds rights to editing those folders/files.
The secret lies in two command-line utilities.
takeown is an old command which resets ownership of the mentioned file/folder while icacls is used to provide a group with the rights to that file/folder.
As Tim points out, you can create a batch file with the following two lines.
takeown /f %1 /r /d y
icacls %1 /grant administrators:F /t
It is imperative to note that the batch file needs to be run as an administrator. This can be done by right clicking the file and clicking on run as administrator.
You could also do what I did. Open command prompt in administrator mode (start > type “cmd” without quotes > right click > run as administrator), browse till the folder/file in question and then use the same two commands by substituting “%1″ with the name of the target file/folder.
Hopefully you were smart enough to figure out that you do need administrator rights to pull this off. So if you’re a script kiddie planning to pull off something on vista, this is not what you’re looking for.
So the next time you cannot delete a file in Windows Vista even though you have administrator rights, try using takeown and icacls ;)
posted by Karun at 5:39 pm
I’m on Windows Vista Ultimate right now and here is what I feel. Its a really good OS since it performs quite well if you have a good box like mine (good being an understatement to most). But the problem is its extremely freakishly irritating rights system. I haven’t really looked around that much but I hate it when i have to confirm every rename 3 times. One for some permissions system and one whether I should allow this action by an “Unauthorized user” I hope they have a setting saying “Allow the administrator to do what he wants” because this is getting out of hand ¬¬.
Oh yes, the backup option in the disc backed up my Adobe settings but not my mIRC settings meaning I’m script-less :( All those weeks of work developing scripts to make my mIRC perfectly suited to my needs for nothing! I have to do it all from scratch. That’s the thing I’m most pissed at.
Despite all that, its an OS that I would like to use if MS doesn’t screw it up with its monthly changes in WGA type systems.
Update:
Veteran Microsoft reporter Paul Thurrott agreed, contending at the time that the implementation of UAC in Vista build 5342 is a “sad, sad joke” given the number of dialog boxes that one must wade through to do simple tasks. However, Thurrott appears to have retracted those comments, claiming in his Windows Vista Beta 2 review, that UAC had been “completely overhauled” and is “less annoying,” although he acknowledges that Microsoft is “still struggling to find a balance between security and annoyance.”
Looks like I’m not alone ;) Thank you Wikipedia!
posted by Karun at 12:12 am
There is a Plus! scripting competition going on that the entire community knows about. With t-shirts for all participants, there have been over 70 entries in 3 weeks. There are only 4 days to go so despite my exams, here is my shot at the competition.
I don’t want to give away much right now but all I can say is its a project that uses JavaScript, Delphi, PHP and mySQL. I don’t think any other script uses all 4 so far. Of course I have my favourite Boca Juniors fan doing the Delphi hax.
Soon you shall see the update on the dev page. But for now, its over and out.
Update: The script was uploaded just in time for the competition. Go check it out ;)
posted by Karun at 11:51 pm
Here it is, the launch of my new site. What is to come, you shall see. I’ve been working on this despite my exams going on cause i wanted to complete this project. I’ve wanted to do this forever now.
Thanks to dt and segosa for their help over the past few days. I may add a new interface but I’d like to keep this one for now, its my first creation from scratch. It will stay at least till the end of exams.
This is going to be different from Jatonian Life How exactly, you ask? Wait and find out ;) I have great things planned for j@x.
Yeah I do need to add rss support. Apart from that and a few repeated calls, I’d say this blog is pretty streamlined. At 12.8 KB (13,151 bytes) including the installer, I’d say its pretty impressive for my first project. I think optimisation could bring it to around 11kb but lets leave that for a rainy day.
posted by Karun at 6:58 pm