cmd


Using Sysinternals from the command line

Recently, we connected to a Windows machine using SSH and downloaded a fresh copy of the Sysinternal suite. When we tried to use PSexec from our command line shell, it would get stuck without warning. We were unaware that the Sysuinteral suite does not prompt the user to accept the EULA agreement without a graphical interface. For this reason, we did not know that we had to take some action, and we were waiting indefinitely for the modules to finish, killing the processes and restarting them.

Eventually, we realized that if we added the following key in the Windows registry, PSexec would be considered by the Sysinternal suite as a EULA agreement acceptance and thus becoming operational again.

reg ADD HKCU\Software\Sysinternals\PSexec /v EulaAccepted /t REG_DWORD /d 1 /f

Windows with ffmpeg — recursively convert all *.mov movies to .mp4. with fixed resolution for android 1

We needed to convert a bunch of mov files to mp4 and while doing that we wanted to shrink them down so that they would fit the screen of an older android device.
We did that both to save space on the internal memory and to make the device perform as efficient as possible as it would not have to shrink the video on the fly.

We downloaded the windows binary for ffmpeg from https://ffmpeg.org/ and copied it to the folder we wanted to execute the command from using Windows Explorer.
After that, while holding the Shift key we right clicked in the Windows Explorer empty area to popup the menu. From the menu we selected Open command window here, that opened a Command Prompt that was already navigated in the folder we placed the binary.
To convert the movies we executed the following:

for /R %f in ("*.mov") do (ffmpeg.exe -i "%~f" -s 864x486 -acodec copy "%~pf%~nf.mp4")

What the above command did was, direct command prompt to find recursively all the files that their name ends in .mov (this is the part that looks like this for /R %f in ("*.mov")) and then execute for each a command, in our case was to convert the file to mp4, resize the video while preserving the audio as is and produce a new file that has the same name but different file extension so that new files will have the mp4 extension instead of mov.