Category Archives: MS-DOS

Make windows files/folders permissions right

There are times on windows when you migrate your files to a new system and you will face the corrupted permission-sets on your files or folders. These 4 cmd commands will help you gain your control over your files again 🙂

<Drive>:
CD \
TAKEOWN /F * /A /R 1 > NUL
ICACLS * /reset /T /Q

Just remember to create a batch file containing those lines above. 🙂

MS-DOS Counted Loops – ITERATION

Using the /L switch for the FOR command, it is possible to count through a loop in MS-DOS; just like any other scripting languages.

Consider this as a very simple sample. It counts from 0 to 99; including both 0 and 99; with a step size of 1 and executes the loop’s body for each iteration.

FOR /L %i IN (0,1,99) DO (
  echo Attempt# %i
  nslookup google.com 4.2.2.4
)