Skip to content

Instantly share code, notes, and snippets.

@Rainyan
Last active June 4, 2023 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rainyan/b44180a3d4490037d9e454e28a8b1177 to your computer and use it in GitHub Desktop.
Save Rainyan/b44180a3d4490037d9e454e28a8b1177 to your computer and use it in GitHub Desktop.
Some doskey macros for limited aliasing-like behaviour on Windows. https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/doskey
;= Some doskey macros for limited aliasing-like behaviour on Windows.
;=
;= To install, drop this file into %USERPROFILE%\.config\macros.doskey, and run:
;= reg add "HKCU\Software\Microsoft\Command Processor" /v Autorun /d "DOSKEY /MACROFILE=\"%USERPROFILE%\.config\macros.doskey\"" /f
;=
;= Be sure to check the doskey docs before relying on this for complex stuff,
;= as there are some nonobvious ways in which more complex commands can fail:
;= https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/doskey
;= Extract audio from a media url using yt-dlp.
;= Usage: yt-dla <url>
yt-dla=yt-dlp --extract-audio $1
;= l builtin...ish
l=dir $1
;= Stream media url to stdout and pipe it into mpv. The "$B" means pipe in this context.
;= Usage: stream <url>
vid=yt-dlp -o - $1 $Bmpv -
;= Console print some VPN info
vpn=curl https://am.i.mullvad.net/connected
windowssucks=taskkill /f /im explorer.exe & start explorer.exe
weather=curl "v2.wttr.in/%CITY%"
;= There's actually no comment syntax available at all, so this final
;= empty "comment" is required to clear the semicolon macro assignment!
;=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment