Hi guys,
After spending the entire morning looking on internet for a solution to the wierd expansion of steam dota2 launcher from "c:\" to "c : \" (which prevents starting dota with params like +playdemo "c:\mydir\replay.dem"), I made this batch msdos file.
It creates a symbolic link (to avoid copying large files) of the clicked .dem file to \dota\replay-batch\ with a clean filename and then starts dota with the params required to play it.
In order to use it, you need to put the following lines in a file, let's say C:\games\replay-dota.bat, change the first line so that dota2 dir match yours, right click a .dem file, "open with"->"choose default program"->browse, pick the file you've created.
If you have better msdos skills and you know how to improve this, I hope you'll share your thoughts with us.
Further easy improvements could be:
- renaming the file or moving to another directory after watching it
- creating other actions in the windows registry classes, so right click could come up with options like "save this demo to your narcissist collection" to easily copy your last meepo game from \dota\replays to a predefined location.
:: CHANGE THIS TO YOUR OWN DIR CONTAINING THE dota.exe FILE
@SET dotadir=C:\GAMES\STEAM\SteamApps\common\dota 2 beta
:: startup params
@SET dotaparams=-novid -console +hideconsole
:: note: +demo_quitafterplayback "1" not working
:: in case of any unknown params, dota will start normally with no replay
::
:: DO NOT EDIT BELOW THIS LINE, UNLESS YOU KNOW WHAT YOU ARE DOING
::
@echo off
setlocal enableextensions enabledelayedexpansion
SET dellink=0
IF NOT EXIST "%dotadir%\dota\replay-batch" (
mkdir "%dotadir%\dota\replay-batch"
echo trace: adding replay-batch dir
)
:: create symlink in replay-batch, removing wierdos from filename, especially :
set "NEWF=%~n1%"
set "NEWF=%NEWF: =_%"
set "NEWF=%NEWF:.=_%"
set "NEWF=%NEWF::=_%"
set "NEWF=%NEWF
=_%"
set "NEWF=%NEWF
=_%"
set "NEWF=%NEWF:&=_%"
set "NEWF=%NEWF:^=_%"
set "NEWF=%NEWF:$=_%"
set "NEWF=%NEWF:#=_%"
set "NEWF=%NEWF:@=_%"
set "NEWF=%NEWF:!=_%"
set "NEWF=%NEWF:-=_%"
set "NEWF=%NEWF:+=_%"
set "NEWF=%NEWF:}=_%"
set "NEWF=%NEWF:{=_%"
set "NEWF=%NEWF:]=_%"
set "NEWF=%NEWF:[=_%"
set "NEWF=%NEWF:;=_%"
set "NEWF=%NEWF:'=_%"
set "NEWF=%NEWF:`=_%"
set "NEWF=%NEWF:,=_%"
echo trace: using %NEWF%.dem as filename
@IF EXIST "%dotadir%\dota\replay-batch\%NEWF%.dem" (
echo **************************************************
echo.
echo.
echo NOTICE:
echo %dotadir%\dota\replay-batch\%NEWF%.dem ALREADY EXISTS.. playing this file instead of %1
echo.
echo if this is not the desired intention, remove the replay-batch\%NEWF%.dem file
echo **************************************************
) ELSE (
mklink "%dotadir%\dota\replay-batch\%NEWF%.dem" %1
echo trace: symlink created
SET dellink=1
)
echo starting dota..
echo on
:: start "dota2" /b /w = not working, pslist/sleep might not be available
"%dotadir%\dota.exe" %dotaparams% +playdemo "replay-batch/%NEWF%.dem"
@echo off
IF %dellink% EQU 1 (
set /p gigi=PRESS ENTER WHEN DONE to delete the replay-batch/%NEWF%.dem file
del "%dotadir%\dota\replay-batch\%NEWF%.dem"
)
exit /b
After spending the entire morning looking on internet for a solution to the wierd expansion of steam dota2 launcher from "c:\" to "c : \" (which prevents starting dota with params like +playdemo "c:\mydir\replay.dem"), I made this batch msdos file.
It creates a symbolic link (to avoid copying large files) of the clicked .dem file to \dota\replay-batch\ with a clean filename and then starts dota with the params required to play it.
In order to use it, you need to put the following lines in a file, let's say C:\games\replay-dota.bat, change the first line so that dota2 dir match yours, right click a .dem file, "open with"->"choose default program"->browse, pick the file you've created.
If you have better msdos skills and you know how to improve this, I hope you'll share your thoughts with us.

Further easy improvements could be:
- renaming the file or moving to another directory after watching it
- creating other actions in the windows registry classes, so right click could come up with options like "save this demo to your narcissist collection" to easily copy your last meepo game from \dota\replays to a predefined location.
:: CHANGE THIS TO YOUR OWN DIR CONTAINING THE dota.exe FILE
@SET dotadir=C:\GAMES\STEAM\SteamApps\common\dota 2 beta
:: startup params
@SET dotaparams=-novid -console +hideconsole
:: note: +demo_quitafterplayback "1" not working
:: in case of any unknown params, dota will start normally with no replay
::
:: DO NOT EDIT BELOW THIS LINE, UNLESS YOU KNOW WHAT YOU ARE DOING
::
@echo off
setlocal enableextensions enabledelayedexpansion
SET dellink=0
IF NOT EXIST "%dotadir%\dota\replay-batch" (
mkdir "%dotadir%\dota\replay-batch"
echo trace: adding replay-batch dir
)
:: create symlink in replay-batch, removing wierdos from filename, especially :
set "NEWF=%~n1%"
set "NEWF=%NEWF: =_%"
set "NEWF=%NEWF:.=_%"
set "NEWF=%NEWF::=_%"
set "NEWF=%NEWF
=_%"set "NEWF=%NEWF
=_%"set "NEWF=%NEWF:&=_%"
set "NEWF=%NEWF:^=_%"
set "NEWF=%NEWF:$=_%"
set "NEWF=%NEWF:#=_%"
set "NEWF=%NEWF:@=_%"
set "NEWF=%NEWF:!=_%"
set "NEWF=%NEWF:-=_%"
set "NEWF=%NEWF:+=_%"
set "NEWF=%NEWF:}=_%"
set "NEWF=%NEWF:{=_%"
set "NEWF=%NEWF:]=_%"
set "NEWF=%NEWF:[=_%"
set "NEWF=%NEWF:;=_%"
set "NEWF=%NEWF:'=_%"
set "NEWF=%NEWF:`=_%"
set "NEWF=%NEWF:,=_%"
echo trace: using %NEWF%.dem as filename
@IF EXIST "%dotadir%\dota\replay-batch\%NEWF%.dem" (
echo **************************************************
echo.
echo.
echo NOTICE:
echo %dotadir%\dota\replay-batch\%NEWF%.dem ALREADY EXISTS.. playing this file instead of %1
echo.
echo if this is not the desired intention, remove the replay-batch\%NEWF%.dem file
echo **************************************************
) ELSE (
mklink "%dotadir%\dota\replay-batch\%NEWF%.dem" %1
echo trace: symlink created
SET dellink=1
)
echo starting dota..
echo on
:: start "dota2" /b /w = not working, pslist/sleep might not be available
"%dotadir%\dota.exe" %dotaparams% +playdemo "replay-batch/%NEWF%.dem"
@echo off
IF %dellink% EQU 1 (
set /p gigi=PRESS ENTER WHEN DONE to delete the replay-batch/%NEWF%.dem file
del "%dotadir%\dota\replay-batch\%NEWF%.dem"
)
exit /b
