forfiles – run commands for each file in a location

forfiles allows command line users to run commands for each file in a location. Some of the tasks that the forfiles command can be used to do are deleting old files and renaming files. It a native command in Vista or newer. For WinXP you can find it in the Recource Kit.


Verifying Active Directory Installation

Check the status of the shared SYSVOL

Verify DNS registration and functionality

Verify communication with other domain controllers

Verify replication with other domain controllers

Verify the availability of the operations masters

How to repair or fully rebuild Windows WMI Repository

For Windows Vista and newer try to run the following:

  1. Verify repo (If the result shown as inconsistent, go to step 2)
  2. Repair repo
  3. Verify repo to check again wmi repository had been repaired successfully

To fully rebuild the WMI Repository follow these steps:

  1. Disable and stop the winmgmt service (Disable is important, elso you can’t rename the folder in step 2)
  2. Rename C:\Windows\System32\wbem\repository
  3. Enable and start the winmgmt service
  4. Open a CMD prompt as Administrator
  5. Navigate to C:\Windows\System32\wbem\
  6. Run the cmd (this will take a minute or so to complete)
  7. Now run the cmd
  8. Now run the cmd
  9. Restart computer

Bypass blocked regedit, concatenate cmd commands & quotes in quotation marks

At a customer I had the problem that we had there a logon scrip, but we were given no access to the registry. Well, we had local administrave permissions. At first I tried runas, but we have to save the password – no chance. Not even echo password works. lsrunase seems to solve the problem, but the version that I found, had problems with quotes in quotation marks. At the end I used a simple AutoIt script.

AutoIt Script (runas.exe)

Change reg entry for HKLM

Change reg entry for current user (HKCU don’t work because you run as local admin!)

Reg changes and file copy (also used quotes in quotation marks and concatenate cmd commands)

ODD drive is not recognized in Windows 8.x/10

After you install Windows 8.x or Windows 10, you may find the CD/DVD drive is not recognized. Resolution:

Open Command Prompt as an Administrator and run the following command:

Reboot the system and verify if the problem has been resolved.

Disable Apple HFS driver helps with Veeam Entpoint Backup and VSS errors

Do you have problems with Veeam Entpoint Backup or Windows Backup fails with VSS error 12289 on a iMac? Just disable the Apple HFS driver and reboot. I use Autoruns from Sysinternals for that:

After that you have no access to the OS X HFS partitions, but for me this is no problem. I haven’t use that any time.