A collection of Windows Scripts, Tips & Tricks useful for automating common & specialized repetitive tasks.
I. Script for creating a Virtual Drive from an ISO Image - using PowerShell
II. Script for converting MKVs to GIFs for GitHub REPOs DEMOs - using PowerShell
(Mounting and Dismounting an ISO Image)
- You receive physical copies (CDs/DVDs), from the hospital, containing X-Ray (Radiography) software and imagery
- One of the devices (PC/laptop) that you/your doctor need(s) to use does not have an ODD (optical disc drive)
- You or the doctor need to check the imagery
- The imagery software only works while in a non-rewrittable environment
- Request from the hospital a copy of the files / gain access to a device that has an optical disc drive, insert the CD/DVD and copy the entire content to a new folder, on a USB stick (for example)
- Use a free software like PowerISO (https://www.poweriso.com/download.htm) in order to create an ISO image from the new folder utilized in the previous step (ISO filename: "rad")
- Download the script from here Mount_ISO.ps1 (right-click and choose "Save link as...")
- Copy/move the script to the same directory that contains the created ISO image
- Execute the script by right-clicking on it and choosing "Run with PowerShell"
- Open Windows Explorer and go to This PC - alongside the Local Disk(s), a virtual drive will be shown
- Double-click on it and review the imagery
Important
Workaround for step 5 - if the script is not executing - follow these steps:
- right-click on it and choose Properties
- at the bottom, check the Unblock box
- click Apply and then OK
- attempt to execute the script again, by right-clicking on it and choosing "Run with PowerShell"
Important
Workaround for step 7 - if a folder is shown - follow these steps:
- double-click on the folder
- locate an executable file (.exe file extension), like "DicomViewer.exe"
- double-click on it and review the imagery
- Open Windows Explorer and go to This PC - alongside the Local Disk(s), a virtual drive will be shown
- Right-click on it and choose Eject
II. PowerShell script for converting video files (e.g. MKV = Matroska Video format) to a GIF (Graphics Interchange Format)
- Record the video - I recommend:
- Software = OBS
- Recording format (output) = Matroska Video (.mkv)
- Muting / not recording audio (not needed)
- Download the script: ffmpegScriptConversionMkvToGif.ps1
- Right-click and choose "Save link as..."
- OR
- Click on link and press key combination
CTRL + SHIFT + S
- Move/copy the script to OBS output folder (default = "C:\Users<username>\Videos\OBS")
- Rename desired file to input (full file name = "input1.mkv")
- Run the script
- From Windows/File Explorer - right-click and choose "Run with PowerShell"
- From PowerShell CLI
cdto script's location-
powershell -ExecutionPolicy Bypass -File .\ffmpegScriptConversionMkvToGif.ps1
Note
- This workflow is useful for creating DEMOs for GitHub REPOs.
- GitHub can display several common image formats, including PNG, JPG, GIF, PSD, and SVG
- The MKV (.mkv) file format is not officially supported as an interactive or playable format on GitHub.
- MKV = Matroska Video = a free, open-source multimedia container format that bundles video, audio, subtitle, and image tracks into a single file
- GIF = Graphics Interchange Format = a digital image file format supporting both static pictures and short, looping, silent animations, widely used on the internet for reactions and short clips
- The resulting GIF file might be bigger than the video file used as input.