Aliases don't work in batch files
Is there any way to make aliases work in batch files?
Using separators like & also doesn't work to execute commands in order, e.g.
ytquality=youtube-dl -F $*
with input
ytquality https://www.youtube.com/watch?v=BaW_jenozKc & ytquality https://www.youtube.com/watch?v=BaW_jenozKc
it recognizes the first alias then the second either doesn't work or isn't recognized by trying also $1, "$1 $T", "$* $T"
What stems from this though is if there is any way to make cmder just execute a list of commands in order outside of a bat file
@Razor-13 Perhaps your issue is a duplicate of #1325?
@jrappen I'm on Windows 7 x64 SP1 and the aliases do work, I'm talking about them working in batch files or after operators (&, &&, ||, etc)
Assuming your shell is cmd.exe, then aliases are a wrapper around the doskey command and you are limited to how doskey macros work -- what you are trying to do is not supported.
From the doskey documentation:
To run a macro, type the macro name starting at the first position on the command line ... You cannot run a doskey macro from a batch program.
So macros cannot be used after another command (i.e. after &, &&, ||) and cannot be used from batch files.
You may want to move those aliased commands to their own bat files on your PATH -- that way you can still use them from the shell, but also have more flexibility in how they can be called.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contribution.
This issue has been automatically closed due to it not having any activity since it was marked as stale. Thank you for your contribution.