To content | To menu | To search

Saturday 13 February 2010

Modifying the Access Control List to Delete Locked Files

Problem: Windows won't let you remove folders or files because of permission rights


Cannot delete folder. Access is denied

You need permission to perform this action. You require permission from COMPUTER\USER to make changes to this folder

You will need to provide administrator permission to change these attributes

Example: You installed a program that sets special permissions to its directory, and after formatting or reinstalling Windows, that folder now belongs to another user (your old account) which you do not have access to. Windows will block your attempt to rename, move, or delete the files or folders.

Cause: Lost user permission (mismatch SID) from previous Windows installation.
Solution: As an administrator, give yourself or everyone permission to the entire directory.
Use the Unlocker program for other access related problems.

Foreword: In the following instructions, the word "target" means the locked file or folder that you want to reclaim. Bolded all-caps words in the code should be replaced with your own input. Move your mouse over the underdotted words for tooltips. All steps will be done inside the Command Prompt, not Windows Explorer. If you are experienced with the Command Prompt, skip to Step 3.

Step 1: Directory

Start button -> enter cmd in the search box -> Command Prompt should be opened
Go to the folder where the target is stored. If your target is in a different hard drive, type: cd /d DRIVELETTER: Example: if the target is in "D:\Program Files", type cd /d D:\Program Files
Type cd DIRECTORY to change directory. Type dir to see the current directory's contents. Type cd .. to go one directory up.

Step 2: Ownership

If you do not have ownership to the target, type: takeown /f TARGET /r Example: if you are in "Program Files" and you want to give yourself permission to the child folder "cygwin", type takeown /f cygwin /r

Step 3: Permission

Assuming you want to delete the target later, the following code gives all permissions to everyone: icacls TARGET /grant Everyone:(OI)(CI)(F) /t If you want to give only yourself permissions, type: icacls TARGET /grant COMPUTER\USER:(OI)(CI)(F) /t To find out your computer name, type systeminfo. Your user name is same as the Windows login.
You may also set permissions in Windows Explorer by right clicking a file -> Properties option -> Security tab Example: icacls TARGET /grant Everyone:(DE) /t will make that target deleteable.

Step 4: Deletion

You should now be able to do anything with the target from Windows Explorer. If you rather use the Command Prompt for deletion, type rmdir TARGET /s /q for a directory, or del TARGET /f for a file.

Command Prompt: icacls /?

Read this help message for more specific permission settings.
ICACLS name /save aclfile [/T] [/C] [/L] [/Q]
    stores the DACLs for the files and folders that match the name
    into aclfile for later use with /restore. Note that SACLs,
    owner, or integrity labels are not saved.

ICACLS directory [/substitute SidOld SidNew [...]] /restore aclfile
                 [/C] [/L] [/Q]
    applies the stored DACLs to files in directory.

ICACLS name /setowner user [/T] [/C] [/L] [/Q]
    changes the owner of all matching names. This option does not
    force a change of ownership; use the takeown.exe utility for
    that purpose.

ICACLS name /findsid Sid [/T] [/C] [/L] [/Q]
    finds all matching names that contain an ACL
    explicitly mentioning Sid.

ICACLS name /verify [/T] [/C] [/L] [/Q]
    finds all files whose ACL is not in canonical form or whose
    lengths are inconsistent with ACE counts.

ICACLS name /reset [/T] [/C] [/L] [/Q]
    replaces ACLs with default inherited ACLs for all matching files.

ICACLS name [/grant[:r] Sid:perm[...]]
       [/deny Sid:perm [...]]
       [/remove[:g|:d]] Sid[...]] [/T] [/C] [/L] [/Q]
       [/setintegritylevel Level:policy[...]]

    /grant[:r] Sid:perm grants the specified user access rights. With :r,
        the permissions replace any previouly granted explicit permissions.
        Without :r, the permissions are added to any previously granted
        explicit permissions.

    /deny Sid:perm explicitly denies the specified user access rights.
        An explicit deny ACE is added for the stated permissions and
        the same permissions in any explicit grant are removed.

    /remove[:[g|d]] Sid removes all occurrences of Sid in the ACL. With
        :g, it removes all occurrences of granted rights to that Sid. With
        :d, it removes all occurrences of denied rights to that Sid.

    /setintegritylevel [(CI)(OI)]Level explicitly adds an integrity
        ACE to all matching files.  The level is to be specified as one
        Inheritance options for the integrity ACE may precede the level
        and are applied only to directories.

        e - enables inheritance
        d - disables inheritance and copy the ACEs
        r - remove all inherited ACEs

    Sids may be in either numerical or friendly name form. If a numerical
    form is given, affix a * to the start of the SID.

    /T indicates that this operation is performed on all matching
        files/directories below the directories specified in the name.

    /C indicates that this operation will continue on all file errors.
        Error messages will still be displayed.

    /L indicates that this operation is performed on a symbolic link
       itself versus its target.

    /Q indicates that icacls should supress success messages.

    ICACLS preserves the canonical ordering of ACE entries:
            Explicit denials
            Explicit grants
            Inherited denials
            Inherited grants

    perm is a permission mask and can be specified in one of two forms:
        a sequence of simple rights:
                N - no access
                F - full access
                M - modify access
                RX - read and execute access
                R - read-only access
                W - write-only access
                D - delete access
        a comma-separated list in parentheses of specific rights:
                DE - delete
                RC - read control
                WDAC - write DAC
                WO - write owner
                S - synchronize
                AS - access system security
                MA - maximum allowed
                GR - generic read
                GW - generic write
                GE - generic execute
                GA - generic all
                RD - read data/list directory
                WD - write data/add file
                AD - append data/add subdirectory
                REA - read extended attributes
                WEA - write extended attributes
                X - execute/traverse
                DC - delete child
                RA - read attributes
                WA - write attributes
        inheritance rights may precede either form and are applied
        only to directories:
                (OI) - object inherit
                (CI) - container inherit
                (IO) - inherit only
                (NP) - don't propagate inherit
                (I) - permission inherited from parent container


        icacls c:\windows\* /save AclFile /T
        - Will save the ACLs for all files under c:\windows
          and its subdirectories to AclFile.

        icacls c:\windows\ /restore AclFile
        - Will restore the Acls for every file within
          AclFile that exists in c:\windows and its subdirectories.

        icacls file /grant Administrator:(D,WDAC)
        - Will grant the user Administrator Delete and Write DAC
          permissions to file.

        icacls file /grant *S-1-1-0:(D,WDAC)
        - Will grant the user defined by sid S-1-1-0 Delete and
          Write DAC permissions to file.
Keywords: Windows 7, Windows Vista, UAC, User Account Control, cacls, cygwin folder, cygwin directory

Wednesday 10 February 2010

jQuery hover event won't fire the first time

Problem: jQuery won't fire when hovered over an element initially.

Example: For a menu with tabs or tooltips that fade in or pop up when a user hovers over, this bug prevents the binded effect from activating when the user hovers over the element for the first time. Such a menu tab would only effect after the user's mouse has entered, left, and entered the element's area again.

Cause: Event bubbling? Multiple nested elements?
Solution: Trigger a hover out event on the element programmatically (instead of by user interaction).
Add the following code after binding the hover function to that element: $('ELEMENT').trigger('mouseout'); The effects-binded element should now fires when mouseovered the first time.

Keywords: JavaScript, onmouseout onmouseover mouseout mouseover mouseenter mouseleave, jQuery won't trigger, jQuery doesn't fire, hover over, the second time
Resources: trigger() function - jQuery API

Wednesday 5 August 2009

SCMOTD #112 - Team Micro Melee

Team Micro Melee

1+2:1+2 Melee Squad Micro, Jungle 128x128 - by Bill307, IntoTheWow in 14 March 2009
Defend your army builder while assaulting the enemy base with various tactical points-earned squads.
Team Micro Melee AG 2.3.scx
Download StarCraft Map: Team Micro Melee, Team Micro Arena
1 Baser 2 Microers per team // Respawn: 10s // Note: numbers in units' names represent their kill points
Features: MoveableSpawnPoint, ConvertPointsToResource, GiveMenToMicroers; Suicide, Upg, Heroes

Award: People's Choice

Belonging to the established Builders and Fighters genre, Team Micro Melee combines regular 1v1 melee with numerous pick-and-choose squads for dynamic gameplay. With the experience-points element, supporting members can advance to stronger units and better upgrades to help protect the builder or lead the assault. As a team game, communication is vital or else a player will have to futilely fend for himself. A couple of mistakes builders usually make are not wisely positioning their squad-spawner (Civ) and not simply entrusting his army to the squads (PsiEm), which are important features to this tactics-focused game.

Tuesday 4 August 2009

SCMOTD #111 - AI Splash Defense

A.I. Splash Def

Individual 5P Walling RetroBottle Defense, Desert 96x96 - by Touchpad_Master in 15 July 2005
Set up auto-defenses to hit your dummy Defilers such that they splash enemies running through.
Download StarCraft Map: AI Splash Defense, AI Splash Defence
Levels: 15 // Stack: Yes // Walling: Safe // Note: read Mission Objectives for defenses listing
Award: Best of Class

The "AI" prefix in the series of mini-defenses came from the original Korean 개인 Lurker Defense map, in which the hangul means "individual", but transcodes to "ÀÎ" on non-Korean localizations. Traits that AI maps all share are the last-man-standing rule, individual tracks, and the characteristic boomerang pathing. In AI Splash Defense, the creator combined the strategy of splash defenses with the minimalism of AI defenses, and as such, walling is even more essential in keeping the enemy vulnerable to fire. AI maps are generally short games, but what makes them more fun than longer ones is the ability to quickly master your strategies to outplay others.

Monday 3 August 2009

SCMOTD #110 - Bomber Probe


7P Probe Jail Tag, Jungle 128x128 - by EL-DUD in early 2000s
Warp in Pylon timebombs along with your vulnerable allies to wipe out lethal wandering enemies.
Download StarCraft Map: Bomber Probe SC, BomberProbe SC, Bomberman, Bomber Man
Levels: 9 // Ban: Host // Tip: to limit friendly fire, don't build Pylons at (+) intersections
Award: Personal Favorite

Most of the quality Bomberman maps are FFA style with quick-thinking gameplay, such as BOMBERMAN 2.7 by [Ghost]Yoon. I chose BOMBER PROBE as the representative of this emulative genre in that it combines the fun of Bomberman games with the familiarity of tag maps. On first play, the map appears to be a Cat & Mice game with the jail zone in the center, and Mice/Probes running away from danger—except that players now have the more powerful ability of blasting away numerous enemies in entire rows or columns. Being the exact opposite of FFA maps, teamwork and especially the avoidance of friendly fire, will be needed as bombers advance through the nine diverse levels.

Sunday 2 August 2009

SCMOTD #109 - Flower Series


5P Battle Dodge Obstacle, Ice 128x128 - by zzerg$$ in mid 2000s
Dodge erratic patterns of deadly projectiles as your blinking gunner barrages each level's boss unit.
Flower of Ice.scx
Download StarCraft Map: Flower Series, Flower of Ice, Flower of Fire, Flower of Blood, Flower of Daemon
Levels: 12 // Lives: 20, +13 buyable per level to self-revive // Features: Music, Ban
Award: Practical Innovation

It was by serendipity that I came across this rather unique Korean map while browsing the English database. Comparable to the hardest bound maps, Flower of Ice adds the excitement of shooting games to the intensity of dodging gameplay. Basically the Flower series is an adaptation of the bullet hell style shooting games, and not being a misnomer, player-controlled ships must dodge rains of instant-kill bullets while strafing the level's boss unit. To adapt the shooting aspect to StarCraft, the creator split the player's "ship" to a dodger (Ling) and a gunner (air unit); the player controls the Ling, while an anti-air unit is constantly created and removed near the Ling to simulate a variable-rate shooter. As it is a challenging game, players will have to practice and replay the map several times to really enjoy its complexity.

Gunner  Rate      Damage  Special
KulM    VeryFast   60+8   destroy all bullets
Alan    Slow      124+26  four Alans attack once
FenD    Medium    111+13  +1 life
Dani    Medium     91+8   -1 life +1 upgrade

Saturday 1 August 2009

SCMOTD #108 - SAT Control 2

Single And Team Control 2

6P Ind+Team Reactive Control, Twilight 128x128 - by thdtjdqja in 2009
Assemble the best squads with alotted cash to fight against armies in your own and the team's arena.
S.A.T. Control 2 [1.1].scx
Download StarCraft Map: Single And Team Control II, SAT Control 2
Levels: 25×2, +Bosses // Difficulties: 4 ±minerals // Tech: Unresearched // Upg: 4 max // Features: Ban, Suicide
Bonus: GasFor1LevelUpgrade (Left), MoreMineralsPerRound (Top), or MoreInitialEnergy (Right)
Note: use all your minerals because they will zero after the timer; computer can cloak and detect

Award: Personal Favorite

Rarely are maps in the same series featured twice in the SCMOTD, but once again the freedom of squad customization and the dynamics of individual and team play—signature to the Single and Team Control series—have proven to make this map very replayable. SAT Control 2 expands from its prequel by letting players choose one of two enemy groups each level and integrating a boss level every five. Gameplay is enhanced by experience points based bonuses, allowing more resources or energy per round. Though the game sometimes limits what players can buy to prevent overpowering the enemy, it is still essentially a sandbox game and players are free to experiment and have fun every time they play.

Friday 31 July 2009

This Is It, SCMOTD

Where are the new SCMOTDs? What kind of daily program takes weeks to update? Who is responsible for this sporadic mess? Why are there so many Korean maps? When are we going to see some <maps from your favorite genre>? To answer some of these theoretically asked questions (since no one gave me feedback about the program), I redirect you to these two prior posts, which in summary say that writing SCMOTDs takes a long time and that I'm also occupied with maintaining Nova's Ark. To the grateful and curious users of the archive and readers of the SCMOTDs, I write to you its memoir.

Jointly in maintenance, the SCMOTD program was planned to last throughout summer and ending in August, culminating with added commentaries for each map. Haphazardly, I was reluctant to post the closing statement until I had finished writing all the commentaries, which has proven to be almost as time consuming as writing the SCMOTDs themselves with me being a very slow writer. Regardless, I will continue to finish commentating, but you can be sure that there will not be as many SCMOTD frequently featuring as before, because August is a holder month for the future months in which I should will be too busy to play and write. But don't be too disappointed, since you yourself would be too productively busy to play StarCraft out of summer, right?

Regarding the new commentary feature, this is where I give personal and subjective reviews that hopefully will help readers respect the effort put into these gems. As an avid egosurfer for my own maps, I know what joy it is to see one's hard work being displayed and appreciated by others—it means that all those hours fiddling in the Campaign Editor provided many more hours of fun to those who played. Since each map featured has diverse merits along with its funness requirement, I grant them one of five awards, which basically are excellence in: functionality, creativity, popularity, or longevity, and maps that are "just good" are awarded as my favorite. For those who wonder why I do not rate maps as in a 1-10 points system, it is because every map featured is indeed a good map, and having rankings assigned will make readers weigh one map over another—an unwanted competition that I avoid also by featuring a map of different genre every day.

Looking back at my time selecting and playtesting maps, it has become a learning experience since I am a fastidious UMS player—playing mostly in the Custom, Defense, Control, and RPG categories (that's why you see more of them). Because I knew the SCMOTD audience is people looking for UMS maps in general, I had to widen my scope to appeal to everyone. More than that, I wanted the readers to learn of the diversity of maps and what they have been missing, and after playing the foreign categories like Conquest, Tug, and Warrior, I indeed know what entertaining games I've been missing. Concerning the genres which have not been featured, it is either that they have no worthy specimen, or just that they are yet to be featured.

On the topic of maps, Nova's Ark is the parent of the SCMOTD program, as it being the quantity to which SCMOTD complements with quality. Currently in my hard drive there are more than 25000 maps, over 10000 of which are included in the archive and map packs. At its beginning, there was about 6000 maps, but with the gathering from numerous StarCraft fansites and several large databases, it has grown to this huge magnitude that requires a daunting amount of time to categorize and quality-check. But since the SCMOTD program had become routine with more people reading it, I focused on maintaining specific genres and series that are popular instead and answering map requests if there need be. Still, I am inquisitive about what the readers prefer: more improvement to the archive or more SCMOTD to be featured?

Closing this memoir, I'm proud to say that the SCMOTDs exceeds the number of Blizzard's own (101 in their map pack) colorful, Map of the Week program. As a grand scheme, I wish those coming to Nova's Ark to be enlightened or enthused about UMS such that they will cultivate the diversity of StarCraft maps onto its promising sequel.

- page 1 of 16