56 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-1
votes
1
answer
85
views
Qt's Qprocess to run CMD gives error of DOSKEY
I am using Qt6.5
I have a button on my UI. When clicking on the button, I want to run a command in CMD. Below is my code when clicking:
QString output, error;
QProcess process;
process.start("cmd&...
0
votes
1
answer
102
views
Macro comands not excuteing in batch file
i am currently in the process of a project and i want to use DOSKEY commands i have in a bat file, for example run program of change direcorties theses commands all work on in my CLI. just wondering ...
0
votes
1
answer
454
views
WSL alias with doskey not working on Windows
For some commercial reasons, I am no longer allowed to use Docker Desktop on my company's computer. However, I installed the Windows Subsystem for Linux (WSL) for using Docker commands directly within ...
1
vote
1
answer
359
views
Sanitizing command parameters in a DOSKEY macro
Let's say I have the following in my AutoRun script:
@doskey cd = @( ^
for /f usebackq^^ delims^^=^^ eol^^= %%a in (^
'$* ' ^
) do @( ^
if "%%~a"==" " ( ^
...
2
votes
1
answer
2k
views
Get date/time of commands from history on windows (cmd/ps)
https://www.2daygeek.com/display-date-time-linux-bash-history-command/
Found this article which seems to show equivalent how to for linux, using HISTTIMEFORMAT environment variable,
# history
1 ...
0
votes
1
answer
349
views
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 ...
1
vote
1
answer
125
views
how to escape findstr /r in a for loop to work in doskey
I have this command
for /F "tokens=2 delims=:" %a in ('ipconfig ^| findstr /R "Default Gateway[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*"') do @ping -t %a
this works fine and extracts my ...
1
vote
1
answer
181
views
doskey to print `$env:Path -split ';'` (in PowerShell), except that doesn't work
Entering $env:path at the prompt correctly returns:
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\...
1
vote
1
answer
275
views
`doskey /macros:all` produces quoted string I can't get rid of
First, I'm in PowerShell and I've entered the doskey /exename=powershell.exe option.
Second, I did something that I now realize doesn't quite work:
doskey envpath=$env:Path -split ';'
The goal was ...
1
vote
1
answer
135
views
Windows Batch Files: How can I append to a *.bat or *.cmd file from within itself?
I'm trying to implement a slight modification to the code provided by @Argyll in this SO answer, specifically changing:
DOSKEY alias=notepad %USERPROFILE%\Dropbox\alias.cmd
to:
doskey alias=echo ...
1
vote
0
answers
133
views
How to keep alias setting with doskey in Azure pipeline?
I am using Azure pipeline with Self-hosted Windows agents to run a local script init.cmd, which is mainly for alias setting with doskey. I am using the following YAML file to configure the pipeline
...
2
votes
2
answers
1k
views
DOSKEY macros break prompts (SET /P) of batch scripts, when run from within same Windows CMD shell
Yes, it's 2021 and I'm still using the CMD shell and batch scripts for simple tasks.
I just recently tried to enhance my workflow by auto-running my own init-script for (each) CMD prompt session, ...
0
votes
2
answers
237
views
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 ...
5
votes
1
answer
4k
views
How to pass command line arguments to a PowerShell script invoked by a doskey
I have a caller.cmd file which has a DOSKEY set like this:
DOSKEY startnow=call powershell getscalled.ps1
Now the script getscalled.ps1 has two switch parameters defined in parameter sets like ...
1
vote
1
answer
236
views
How to escape all quotes in $* to pass it to PowerShell from CMD
I experience some problem with executing PowerShell command from CMD.
I have a function MyFunction in PowerShell which takes two parameters: Id and Text.
Example:
MyFunction 12345 "Name = Karl"
I ...