“rm -rf” equivalent for Windows?

RMDIR or RD if you are using the classic Command Prompt (cmd.exe): rd /s /q “path” RMDIR [/S] [/Q] [drive:]path RD [/S] [/Q] [drive:]path /S Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree. /Q Quiet mode, do not ask if ok to … Read more

Adding a directory to the PATH environment variable in Windows

Option 1 After you change PATH with the GUI, close and re-open the console window. This works because only programs started after the change will see the new PATH. Option 2 This option only affects your current shell session, not the whole system. Execute this command in the command window you have open: set PATH=%PATH%;C:\your\path\here\ … Read more

How do I shutdown, restart, or log off Windows via a bat file?

The most common ways to use the shutdown command are: shutdown -s — Shuts down. shutdown -r — Restarts. shutdown -l — Logs off. shutdown -h — Hibernates. Note: There is a common pitfall wherein users think -h means “help” (which it does for every other command-line program… except shutdown.exe, where it means “hibernate”). They … Read more

Batch file to delete files older than N days

Enjoy: forfiles -p “C:\what\ever” -s -m *.* -d <number of days> -c “cmd /c del @path” See forfiles documentation for more details. For more goodies, refer to An A-Z Index of the Windows XP command line. If you don’t have forfiles installed on your machine, copy it from any Windows Server 2003 to your Windows XP machine at %WinDir%\system32\. … Read more

How do I run Redis on Windows?

Historically, Microsoft had a Windows port of redis, which was released as Redis-64, which offers a full distribution of redis for Windows. The Microsoft port is now deprecated, but some alternatives have sprung up to fill that void: Memurai is the alternative officially recommended on the Redis-64 deprecation page; it is a commercial offering with … Read more

How to export/import PuTTY sessions list?

Export cmd.exe, requires elevated prompt due to regedit: Only sessions (produces file putty-sessions.reg on the Desktop): regedit /e “%USERPROFILE%\Desktop\putty-sessions.reg” HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions All settings except ssh keys (produces file putty.reg on the Desktop): regedit /e “%USERPROFILE%\Desktop\putty.reg” HKEY_CURRENT_USER\Software\SimonTatham Powershell: Only sessions (produces file putty-sessions.reg on the Desktop): reg export HKCU\Software\SimonTatham\PuTTY\Sessions ([Environment]::GetFolderPath(“Desktop”) + “\putty-sessions.reg”) All settings except ssh keys … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)