Announcement

Collapse

Forum Rules

  • No flaming or derogatory remarks, directly or through insinuation.
  • No discussion, sharing or referencing illegal software such as hacks, keygen, cracks and pirated software.
  • No offensive contents, including but not limited to, racism, gore or pornography.
  • No excessive spam/meme, i.e. copious one liners in a short period of time, typing with all caps or posting meme responses (text/image).
  • No trolling, including but not limited to, flame incitation, user provocation or false information distribution.
  • No link spamming or signature advertisements for content not specific to Dota 2.
  • No Dota 2 key requests, sell, trade etc.
  • You may not create multiple accounts for any purpose, including ban evasion, unless expressly permitted by a moderator.

  • Please search before posting. One thread per issue. Do not create another thread if there is an existing one already.
  • Before posting anything, make sure you check out all sticky threads (e.g., this). Do not create new threads about closed ones.
  • It is extremely important that you post in correct forum section.

  • Balance discussion only in Misc.
  • All art related (such as hero model) feedbacks go to Art Feedback Forum.
  • All matchmaking feedback should go here: Matchmaking Feedback
  • All report/low priority issues should go here: Commend/Report/Ban Feedback
  • No specific workshop item feedback. These should go to workshop page of that item.
  • When posting in non-bugs section (such as this), use [Bugs], [Discussion] or [Suggestion] prefix in your thread name.



In case you object some action by a moderator, please contact him directly through PM and explain your concerns politely. If you are still unable to resolve the issue, contact an administrator. Do not drag these issues in public.



All rules are meant to augment common sense, please use them when not conflicted with aforementioned policies.
See more
See less

[ solution ] double click .dem starts dota2 in replay mode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [ solution ] double click .dem starts dota2 in replay mode

    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
Working...
X