Batch Renaming of Files using PowerShell

Windows PowerShell is a very powerful tool for many tasks. The following are two examples using it for batch renaming of files in a folder.

1) Removing the first character from the existing filename, and

2) Replacing a special character with another character in the filename. Adjust the parameter value for your specific requirements.

get-childitem *.txt | rename-item -newname { string.substring(1) }

Dir | Rename-Item –NewName { $ –replace “+”,” ” }

Posted in Tips & Tricks

Uninstall Stubborn Programs

When you don’t need certain a program and try to uninstall it, sometimes a problem may occur preventing it from cleanly installed. In other cases, some programs may even refuse to be uninstalled perhaps because of compatibility when Windows had been upgraded. The following free program may do the trick in a very respectable way. Give this a try.

Posted in Tips & Tricks

Install Windows on USB Flash Drive or External Hard Drive

AOMEI Partition Assistant

You probably have heard of Windows 8 to Go, which allows you install a portable version of Windows 8 on a Microsoft certified USB flash drive. If you are addicted to the old operating system (OS) Windows 7, you may wonder is there a way to install Windows 7 on USB removable storage device?

With Windows 7 on a USB flash drive or external hard drive, you can take it with you wherever you go and run Windows7 on any PC.

Windows Setup can detect USB hard drive, but when you select the external drive as the target location to install Windows 10/8/7, you will get the error “Windows cannot be installed to this disk”. Luckily, there is a workaround for this, and it is quite simple. Even those who does not know how to install Windows from a USB drive can follow this guide to get it done. (read the whole story)

Posted in Tips & Tricks

How to delete large folders super fast

The two commands that users require are Del, for deleting files, and Rmdir, for removing directories.

  • Tap on the Windows-key, type cmd.exe and select the result to load the command prompt.
  • Navigate to the folder that you want to delete (with all its files and subfolders). Use cd path, e.g. cd o:\backups\test\ to do so.
  • The command DEL /F/Q/S *.* > NUL deletes all files in that folder structure, and omits the output which improves the process further.
  • Use cd.. to navigate to the parent folder afterwards.
  • Run the command RMDIR /Q/S foldername to delete the folder and all of its subfolders.

The commands may require some explanation.

DEL /F/Q/S *.* > NUL

  • /F — forces the deletion of read-only files.
  • /Q — enables quiet mode. You are not ask if it is ok to delete files (if you don’t use this, you are asked for any file in the folder).
  • /S — runs the command on all files in any folder under the selected structure.
  • *.* — delete all files.
  • > NUL — disables console output. This improves the process further, shaving off about one quarter of the processing time off of the console command.

RMDIR /Q/S foldername

  • /Q — Quiet mode, won’t prompt for confirmation to delete folders.
  • /S — Run the operation on all folders of the selected path.
  • foldername — The absolute path or relative folder name, e.g. o:/backup/test1 or test1

Posted in Tips & Tricks

Overlay Videos

You can try the following if you would like to overlay a video onto a master (background) video, without re-encoding.

ffmpeg.exe -i master_video.mp4 -vf “movie=smaller_inner_video.mp4[inner];[in][inner] overlay=70:70 [out]” completed.mp4

where 70:70 in this example are the positions that you would like the smaller video to be overlaid onto the master.

Posted in FFmpeg, Tips & Tricks

Crop a Video

The following example shows how you can use FFMPEG to crop a video without re-encoding.

ffmpeg -i input.mp4 -filter:v “crop=1280:200:0:500” -c:a copy output.mp4

where 1280 and 200 are the output size (width and height) of the cropped video, 0 and 500 are positions where the cropping will start.

Posted in FFmpeg, Tips & Tricks

DVD Ripper – SmartRipper

If you would like to rip a DVD with multiple audio tracks (e.g. karaoke discs) into individual files for each chapter, you can consider using an old and primitive program called SmartRipper (but it works, even in Windows 10). Change the settings to split files by chapter and you will get a VOB file for each chapter in the DVD title. Rename file extension from VOB to MPG. All audio tracks will be preserved. Download the program from this link. There is no installation; just run the application after unzipping the downloaded file.

Posted in Tips & Tricks

Extract Audio and Adjust Volume

The following are two common usages of FFMPEG.

The first command extracts an audio track from a video file in the exact format that it was multiplexed info the video file.

The second example shows how you can adjust the volume of an audio file with re-encoding.

ffmpeg -i input.mpg -map 0:1 -acodec copy -vn output.ac3
ffmpeg -i input.ac3 -filter:a “volume=10dB” output2.ac3

Posted in FFmpeg, Tips & Tricks

Converting MP4 Videos to MPEG

The following command converts an MP4 video to an MPEG video with high quality:

ffmpeg -i input.mp4 -c:v mpeg2video -q:v 5 -c:a mp2 -f vob output.mpg

Posted in FFmpeg, Tips & Tricks

Converting a Video without Re-encoding

FFMPEG can be used to convert a video from one format to another. Very often, the video itself to be converted is already encoded in an appropriate format. You just want to convert the container format.

In the following example, the source video is encoded in MPEG-2 in an MKV container. It will be converted to an MPG video. No re-encoding is required since the source video is already in the target format. You can also select one or more audio tracks during conversion if this is part of the requirements.

ffmpeg -i input.mkv -map 0:a:1 -map 0:v -c:v copy -c:a copy output.mpg

Posted in FFmpeg, Tips & Tricks