Categories:

Email
  🠪  Servers
  🠪  Testing
  🠪  Tips

Hardware
  🠪  3D Printing
  🠪  Apple
  🠪  Batteries
  🠪  Drives
  🠪  Edgerouter
  🠪  Electronics
  🠪  Laptop
  🠪  Modems
  🠪  Phone
  🠪  Printers
  🠪  Raspberry Pi
  🠪  Virtualization

Links
  🠪  Interesting
  🠪  Media

Network
  🠪  Data
  🠪  Testing
  🠪  VPN

Scripts
  🠪  Batch
  🠪  Linux
  🠪  Powershell

Servers
  🠪  Databases
  🠪  Misc
  🠪  Website

Software
  🠪  Other

Utilities
  🠪  Backup
  🠪  Fix Issues
  🠪  Recovery

Video
  🠪  Editing

Websites
  🠪  HTML
  🠪  Testing

Windows
  🠪  Adjustments
  🠪  Issues
  🠪  Remote Desktop
  🠪  Sercurity
  🠪  Slow
  🠪  Software
  🠪  Startup

Submit Entry
Airin's Notes

Category: Scripts 🠪 Batch
Backup File - Template
October 28, 2021

@echo off
for /f %%i in ('powershell ^(get-date^).DayOfWeek') do set dow=%%i
echo %dow%
rem The above now has the day like "Tuesday" or "Friday" set as an environment variable

robocopy /mir /r:0 /DCOPY:T /xj c:\ "h:\Backups\Daily\%dow%"


Category: Scripts 🠪 Batch
Convert media file using ffmpeg
October 28, 2021

Put the following in a batch file. You will need to download ffmpeg and place it in some path.
https://ffmpeg.org/download.html


--------------- Start --------------
@echo off
set ffmpeg="C:\Tools\Utils\ffmpeg-win-2.2.2\ffmpeg.exe"
set infolder=C:\Temp\In-WAV
set outfolder=C:\Temp\Out-MP3
set infiletype=wav
set outfiletype=mp3

echo Starting!
echo Input folder: %infolder%
echo Output folder: %outfolder%
echo Input filetype: %infiletype%
echo Output filetype: %outfiletype%
echo.

cd...<Too long, click to read the rest>


Category: Scripts 🠪 Batch
Cycle Network adapter to make the link light flash
October 26, 2021

@echo off
set message=Press C to cancel this script.
set delay=10
set interface=Ethernet
set /a count = 0
echo Starting disabling of '%interface%'interface. It will be disabled every %delay% seconds.
:start
set /a count += 1
echo.
echo.
echo Disabling Ethernet... Loop #%count%
netsh interface set interface "%interface%" disabled
CHOICE /C CL /M "%message%" /D L /T %delay% /N
if '%ERRORLEVEL%'=='1' goto done
echo Enabling Ethernet... Loop #%count%
netsh interface set interface "%interface%" en...<Too long, click to read the rest>


Category: Scripts 🠪 Batch
Robocopy
October 23, 2021

This page explains options quite well:
https://superuser.com/questions/814102/robocopy-command-to-do-an-incremental-backup

Copy folder modified date
/DCOPY:T


Category: Scripts 🠪 Batch
Run command for each commandline argument passed
October 23, 2021

%%x will effectively equal %1, then %2, etc.


for %%x in (%*) do (
powershell.exe -File "%ps1path%" -File "%%x"
)


Category: Scripts 🠪 Batch
Tips
October 26, 2021

rem Set the date in the format "2020-10-24" to the variable %Today%
FOR %%A IN (%Date%) DO (
FOR /F "tokens=1-3 delims=/-" %%B in ("%%~A") DO (
SET Today=%%D-%%B-%%C
)
)
echo Date to use for filenames: '%Today%'


Category: Scripts 🠪 Batch
Upload file via FTP
October 26, 2021

Put the FTP command script in a .txt file, then make a shortcut or batch file containing:
ftp.exe -s:C:\Temp\testftp.txt

Below is the script to put in a text file:
---------------------- Start ----------------------
open ftp.server.com
theusername
thepassword
binary
prompt
cd "ftp.server.com"
lcd "C:\Temp\Uploads"
put 1.mp3
bye
--------------------- End -----------------------


Category: Scripts 🠪 Batch
VSS - Volume Shadow Copies
October 27, 2021
Mount shadow volumes on disk images
https://forensicswiki.xyz/wiki/index.php?title=Mount_shadow_volumes_on_disk_images

diskpart
select vdisk file=C:\myimage.vhd
attach vdisk readonly

vssadmin list shadows
vssadmin list shadows /for=E:\
vssadmin list
mklink /D C:\shadow_volume_1 \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy7\
rd C:\shadow_volume_1


Configure VSS on Windows Server
https://helpcenter.itopia.com/en/articles/724296-configuring-volume-shadow-copies-vss-on-windows-...<Too long, click to read the rest>




This site is meant to be used as a reference for myself, although others may find it useful. I use it to keep track of certain fixes, software, and other solutions which I may need while assisting customers. The page layout is pure HTML/CSS and is kept simple to optimize loading time and fast results.

Return to Airin's Computers