Skip to content

Instantly share code, notes, and snippets.

@MobCat
Last active July 26, 2022 01:20
Show Gist options
  • Select an option

  • Save MobCat/c14aa129bbc284c1f6683208a8a09807 to your computer and use it in GitHub Desktop.

Select an option

Save MobCat/c14aa129bbc284c1f6683208a8a09807 to your computer and use it in GitHub Desktop.
Draft 1.2 for automatically dumping a xbox screenshot to a mapped network drive.
@echo off
::Please note, this is for use with the official XboxSDK (XDK) installed into your computer and your xbox devkit on the same network.
::Setup for automaticly getting the name of your defult xbox devkit
::TODO Find out if I can get running app title aswell.
setlocal ENABLEEXTENSIONS
set KEY_NAME=HKEY_CURRENT_USER\Software\Microsoft\XboxSDK
set VALUE_NAME=XboxName
for /F "usebackq tokens=1,2,*" %%A IN (`reg query "%KEY_NAME%" /v "%VALUE_NAME%" 2^>nul ^| find "%VALUE_NAME%"`) do (
set XboxName=%%C
)
::Change this to wherever you want to save your screenshots to.
::Remember to change both the drive letter and the directory with the same drive letter
P:
cd "P:\Xbox Screenshots"
::Set datetime for when screenshot was taken
::On XP, windows is weird sometimes.. most times..
::YYYYMMDD-HHMMSS
set date=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%-%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
::Main screenshot command using the MS XboxSDK
xbcapture %XboxName%-%date%.bmp
::ImageMagick-6.8.6-8 auto convert to png and delete bmp for social media posting.
C:\ImageMagick\convert.exe ephemeral:"%XboxName%-%date%.bmp" "%XboxName%-%date%.png"
::If you want to keep the bmp aswell you can remove the ephemeral: command
::You can also just comment out this hole command if you don't want to auto convert.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment