Questions tagged [doskey]

Windows command that recalls previously entered command-line commands, edits command lines, and creates command macros. Cannot be used in a batch file.

Documentation:

54 questions
1
vote
1 answer

How to add a post-fix to a DOSKEY [CMD]

I would like a prefix to run a command but slightly differently, for example openlink (opens the link) Then I would like to be able to say open it 2 times by using a prefix, for example openlink *2 (opens the link twice) I would like the number to…
1
vote
1 answer

Add single doskey command - Windows Registry

I'm working on a batch file, and I need to add this entry: doskey wfreerdp="C:\Program Files\wfreerdp\wfreerdp.exe" $* to this regkey: HKCU\Software\Microsoft\Command Processor I played with the options of reg add, but I simply cannot get it to…
1
vote
1 answer

Removing quotes from doskey macro (export=set)

I'm trying to remove incoming quotes for a doskey macro that will let me use "export" as "set". Here's what I have: doskey export=set $* Except when I run with the following: export VAR="value" I end up with: VAR="value" vs what I…
Paul
  • 11
  • 1
1
vote
1 answer

Print all existing doskeys

Windows uses doskey to do something like Unix's alias. To display all existing Unix aliases I can simply type alias with no arguments. However, on Windows, typing doskey with no arguments does nothing. How can I display all existing doskeys?
MD XF
  • 7,860
  • 7
  • 40
  • 71
1
vote
1 answer

The doskey command separator produces blank lines

The doskey command separator ($T) generates a blank line when the command produces no output. C:\> set "a=" C:\> set "b=" C:\> doskey test=set…
antonio
  • 10,629
  • 13
  • 68
  • 136
1
vote
1 answer

Run alias command from command prompt in new command prompt

So I've set up a file with some aliases for commands that I commonly use. I added it to the registry like in this answer. I want to use this alias like so: >cmd /k newalias 'newalias' is not recognized as an internal or external command, operable…
1
vote
1 answer

Setup windows doskey for echo > filename.txt

My goal is to setup doskey to imitate unix touch command as touch filename.txt Without doskey I use echo . > filename.txt in the windows's command prompt I successfully setup doskey touch=echo $* but I must use it as touch > filename.txt, I have…
Artisan
  • 4,042
  • 13
  • 37
  • 61
1
vote
1 answer

cmd alias for printing out sizeof folder cygwin

I currently try to figure out How exactly i can generate a Doskey Alias that allows Pipes. I want to gather the foldersize in kB. I have tried alias dirsize=du -P -c -a -b $1 | grep total | awk '{print "Folder has: " $1 "kB"}' But i simply get…
r4d1um
  • 528
  • 1
  • 9
  • 32
1
vote
1 answer

Windows cmd executing multiple doskey macros with &&

In my Linux development environment I have become accustomed to building and deploying my code in one line commands, for example: mvn clean package && ./deploy.sh localhost I have written bash aliases that simplify this process, in my environment…
Vander Rice
  • 161
  • 1
  • 10
1
vote
2 answers

windows cmd(clink) doskey, how to copy the current directory to clipboard, prepended by "cd"?

It is ok to do this in the command line: C:\Users\ken.chen>echo|set /p=cd %cd%|clip C:\Users\ken.chen>cd C:\Users\ken.chen C:\Users\ken.chen\nuts\notes>echo|set /p=cd %cd%|clip C:\Users\ken.chen\nuts\notes>cd C:\Users\ken.chen\nuts\notes but the…
thinker3
  • 12,771
  • 5
  • 30
  • 36
0
votes
1 answer

How do I add a variable to a doskey command that will read the variable after it executes (not get the current variable)

I have this command: doskey cd = cd /d $* ^&^& echo "You are in: "%cd% doskey cd = cd /d $* ^&^& title %cd% When I paste this in CMD it will set the current cd and not dynamically when I recall the cd from the doskey. Current output: C:\>doskey cd =…
0
votes
2 answers

Windows BAT script for cp alias produces error

I wrote a file called cp.bat and the content of this file is: DOSKEY cp=COPY $* copy. I saved this file in c:\users\myname\aliases. I also added this path to my environment so cmd can execute it. When I now type cp in my cmd the output is a strange…
Echon
  • 61
  • 5
0
votes
0 answers

Text expansion in Cmder / ConEMU

A long time ago, I set my Cmder (ConEMU) to expand "~" to C:\Users\%USERNAME%. Embarrassingly, I have forgotten how I did it. Now I'd like to un-do it. I've checked my alias files and ran "Multifind" searches in the /Cmder directory, but have not…
TecBrat
  • 3,643
  • 3
  • 28
  • 45
0
votes
0 answers

use doskey to replace part of command

I want to run doskey macros one after other. Since doskey a = "some big command" doskey b = "other big command" .. .. and a && b does not work, I do for /l %i in (1 1 1) do ( a b ...) I want to replace this using a small command like run (a b c…
bunny10245
  • 105
  • 8
0
votes
1 answer

How do I set the value of multiple variables in a macro in batch?

I am writing a script template to install multiple MSI's, including error logging and a rollback function. It contains scriptblocks to store install and uninstall information of each MSI. @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION :: Global…
jnoort
  • 71
  • 4