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.
forfiles -p "E:\VideoArchiv" -s -m * .asf -d -01 .01 .2014 -c "cmd /c echo @path >> E:\del.txt"
Hold down [Shift] while choosing Restart
Check the status of the shared SYSVOL
Verify DNS registration and functionality
Verify communication with other domain controllers
nltest /dclist : <domain name >
Verify replication with other domain controllers
dcdiag /test :replications
Verify the availability of the operations masters
dcdiag /s : domaincontroller /test :knowsofroleholders /verbose dcdiag /s : domaincontroller /test :fsmocheck
For Windows Vista and newer try to run the following:
Verify repo (If the result shown as inconsistent, go to step 2)
winmgmt / verifyrepository Repair repo
winmgmt / salvagerepository Verify repo to check again wmi repository had been repaired successfully
winmgmt / verifyrepository
To fully rebuild the WMI Repository follow these steps:
Disable and stop the winmgmt service (Disable is important, elso you can’t rename the folder in step 2)
Enable and start the winmgmt service
Open a CMD prompt as Administrator
Navigate to C:\Windows\System32\wbem\
Run the cmd (this will take a minute or so to complete)
for /f %s in ( 'dir /b *.mof' ) do mofcomp %s Now run the cmd
for /f %s in ( 'dir /b en-us\*.mfl' ) do mofcomp en -us \ %s Now run the cmd
for /f %s in ( 'dir /b de-DE\*.mfl' ) do mofcomp de -DE \ %s Restart computer
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)
Local $sUserName = "Administrator" Local $sPassword = "password"
;Run a command prompt as the other user. if $CmdLine [ 0 ] > 0 Then RunAs ( $sUserName , @ ComputerName , $sPassword , 0 , $CmdLine [ 1 ] ) endif
Change reg entry for HKLM
\ \server \scripte $ \runas .exe "reg add " "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation" " /f /v " "DisableStartupSound" " /t REG_DWORD /d " "0" " "
Change reg entry for current user (HKCU don’t work because you run as local admin!)
for /f "delims= " % %a in ( '"wmic path win32_useraccount where name=' %UserName% ' get sid"' ) do ( if not "%%a" == "SID" ( set SID = % %a goto :loop_end ) ) :loop_end echo %sid%
\ \server \scripte $ \runas .exe "reg add " "HKU\%SID%\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" " /f /v " "VisualFXSetting" " /t REG_SZ /d " "3" " "
Reg changes and file copy (also used quotes in quotation marks and concatenate cmd commands)
\ \server \scripte $ \runas .exe "reg add " "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background" " /f /v " "OEMBackground" " /t REG_DWORD /d " "1" " "
\ \server \scripte $ \runas .exe "cmd /c mkdir C:\Windows\System32\oobe\info\backgrounds&net use \\server\scripte$ /user:contoso.local\admin password&echo d|xcopy " "\\server\scripte$\Wallpaper\backgroundDefault.jpg" " " "C:\Windows\System32\oobe\info\backgrounds\backgroundDefault.jpg" " /Y /R /E /S /C"
Open Group Policy Editor (gpedit.msc), goto
Computer Configuration > Administrative Templates > Control Panel > Personalization > Do not display the lock screen
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:
reg . exe add "HKLM\System\CurrentControlSet\Services\atapi\Controller0" / f / v EnumDevice1 / t REG_DWORD / d 0x00000001
Reboot the system and verify if the problem has been resolved.
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.