This question already has answers here:
How do I minimize the command prompt from my bat file
(14 answers)
Closed 6 years ago.
I have Created Text file where it contains dispart commands and I run it from
The Batch File using the code below:
#echo off
Diskpart.exe /s D:\script.txt
Hopefully, That's works fine but there is something I don't want it to happen anymore and that was when Dispart.exe opened.It is openning maximized.
So how to make it openning minimized?
Use this command in your .bat file:
start /min diskpart
Hope this helps. Good luck!
Related
This question already has answers here:
How can you get the clipboard contents with a Windows command?
(14 answers)
Access clipboard in Windows batch file
(11 answers)
Closed 2 years ago.
I am working on a batch script that runs .exe files in a given folder. It should do something like this:
SET /P _inputname= Please enter app folder path:
cd %_inputname%
dir /s /b *.exe | clip
"paste-from-clipboard"
However, for my last line, I haven't found a way to paste from clipboard without using a mouse/keyboard shortcut. I would greatly appreciate it if anyone has a solution.
To copy & paste within windows command line you can use:
https://github.com/kpym/windows-paste
It's the successor of the once famous paste.exe.
See also How can you get the clipboard contents with a Windows command?
This question already has answers here:
Escape percent in bat file
(1 answer)
Ignore percent sign in batch file
(6 answers)
Escape percent signs in given variables
(1 answer)
Is there a way to escape % while using call in batch file?
(2 answers)
How does the Windows Command Interpreter (CMD.EXE) parse scripts?
(8 answers)
Closed 3 years ago.
I had just showed a friend of mine some of the cool stuff you can do with the command prompt and batch code and she gotten really interested and wants to try it out on her own when she has the time. Shortly after that, I had gotten the idea of making a nice, well polished batch file that will not only demonstrate, but also display display the code in the code on the command window with out the command window executing the commands.
Example: the code in question, %date%, will display the current date when I have the code of echo %date% on the line. I would like to have %date% to be displayed like normal text.
What code am I missing to have %date% and %time% and any other batch code be displayed as normal text so the person having fun with the file can see the code without having to cipher through the code to find the code I am wanting them to learn?
P.S.
I have a feeling this question might have been answer through a different thread and if so, fee free to link me to it. Thank you!
This question already has answers here:
using batch echo with special characters
(8 answers)
Closed 4 years ago.
I have a BATCH script that will create a text file that will later be executed by another program based on user input. I want to be able to echo Label>start to a text file. Unfortunately, CMD reads it as a command (because of the > character) and does not echo properly. If I use quotation marks they echo to the .txt file
"Level>start"
and so it cannot be executed. I really need some help with this.
echo Level^>start
seems to work.
This question already has answers here:
How do I get current date/time on the Windows command line in a suitable format for usage in a file/folder name?
(30 answers)
Closed 7 years ago.
I am fairly new with creating batch files.
I have made a batch file with the following content:
"C:\Program Files (x86)\Runtime Software\DriveImage XML\dixml.exe" /bC /c /l /t"B:\DRIVE IMAGES\Windows10_maintenance_backup
This allows me to run DriveImage XML and take a backup simply by running the bat file.
I would like the bat file to automatically make a folder with today's date so that:
B:\DRIVE IMAGES\Windows10_maintenance_backup
Becomes:
B:\DRIVE IMAGES\2016.01.20\Windows10_maintenance_backup
How can I achieve this by editing the .bat file?
I have had a look at foxidrives solution here but I do not know how to implement the solution.
echo md B:\DRIVE IMAGES\%date:~-4%.%date:~7,2%.%date:~4,2%\windows10\etc
See set /? for help on substring extraction.
This assumes date is in following format
Thu 21/01/2016
This question already has an answer here:
Batch file creating another batch file, how to ignore commands when writing lines?
(1 answer)
Closed 7 years ago.
So, on school we need to make this assignment.
So we tried to make a bat file that make's some folders and dox.
but the problem is: we want to let the bat file make another bat file.(with commands in it)
but if we write it like:
echo. #echo off F: tree/f>menu.bat
this creates a .bat file that doesn't work. probebly cause we didnt add lines. so how to do this?
how do we fix this?
looking forward to it.
You can use the >> operator to add lines to existing files. One > by itself will create a new file (or overwrite the contents of an existing file).
echo #echo off >menu.bat
echo F: >>menu.bat
echo tree /f >>menu.bat