w w w . t j e e n a . s e

The digital life of Jörgen Larsson


Mixed CMD commands


Silent exe:	taskkill /f /im iexplore.exe /fi "memusage gt 2" >nul
Regular exe:	taskkill /f /im iexplore.exe
Window:	        taskkill /FI "WINDOWTITLE eq CutePDF*"

Check if x86 or x64

if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto AMD64 (or "x86" if that's your flavor)

Copy files to Windows\System32 on x64 Windows 7 (uses 32-bit cmd)

%SystemRoot%\SysWoW64\cmd.exe /copy "C:\file.txt" "%SystemRoot%\SysNative\" /y

Path to where .cmd is run from

%~dp0    (automatically adds trailing \ to the end of path)

Remove stubborn unremovable/corrupt bad folder/file on file server.
Create an empty directory somewhere. Run the commandline, then delete both folders.

robocopy.exe newemptydirpath oldbaddirpath /MIR

Grant authenticated users modify permission to specified folder and subfolders

icacls.exe "%PROGRAMFILES%\APP" /grant *S-1-5-11:(OI)(CI)(M) /C /Q

Delete scheduled task

schtasks /Delete /TN "Adobe Flash Player Updater" /F

Run cmd on first startup (as user), then automatially gets deleted


Swedish characters in batch-file (there’s one after Å= but it’s invisible)

å=†   ä=„   ö=”   Å=    Ä=Ž   Ö=™

Leave a Reply

Your email address will not be published. Required fields are marked *