Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cmd.exe]

cmd.exe, or the Command Prompt, is the default command-line interpreter for many Microsoft-created operating systems.

1
vote
1answer
53 views

Get path of a file without it's name

The file song.mp3 is located in C:\x-folders\y-folder\z-folder\song.mp3 How can I store this path in a variable? C:\x-folders\y-folder\z-folder\ Thank you
0
votes
2answers
81 views

Filter files whose names contain a keyword in CMD

In working on a script that computes, and outputs to a file, the total cyclomatic complexities of a project under test, I am trying to filter out files whose names (including path) contains "test". (...
2
votes
1answer
13 views

Prefix filenames with several parent folder names in cmd

Challenge Expanding on this post, how can you prefix filenames to include their parent folder names. @dbenham response (see below) is great, but it only prefix' the immediate parent folder's name in ...
0
votes
0answers
17 views

Windows 10 wont boot HP probook 430 G2 2014 model

In powershell I tried the command "Shutdown" and my computer shut down then when I powered it back on I got a disk error 301 so I went to cmd and activated my boot partition and since then I have had ...
1
vote
0answers
41 views

Windows - Powershell automatically moving files into the corresponding folders [closed]

I have a lot of files and folders. The filenames have the same name as the folders I have created for them. Here is an example from what I want to automate: Since there is a lot of PDF, MID and MSCZ ...
0
votes
1answer
35 views

Why file content is not remain after unmount a drive in linux?

I wrote a script on bashrc.cmd from my windows 10 to activate my virtual environment automatically. I pointed the path of bashrc.cmd into AutoRun according to this post. bashrc.cmd @echo off CD dev-...
1
vote
1answer
24 views

Set arbitrary text to windows clipboard

I'm using clip to set text on the clipboard. To do that, I use echo. echo Works|clip The problem is when the text contains special characters, eg. | ". echo (TRUE|FALSE)|clip echo " is a Quote Mark|...
1
vote
2answers
44 views

CMD command execution

I am trying to execute a specific command in a bat script after finding the path to the folder. Here is what I have so far: @ECHO OFF cmd /k "cd C:\"Program Files (x86)\"Microsoft Office\Office15\" ...
4
votes
1answer
105 views

How to keep the command line prompt on the first line of terminal?

I need to keep the command line on the top of the screen and see the output of any command below it. How can I achieve this using any available tools on any platform? Currently, on the all terminal ...
1
vote
1answer
40 views

How to move a specific file type found on the entire drive to another folder [duplicate]

So, I want to move all JPG files on the entire drive (Including other users) to a folder on the desktop. What's the command in CMD? The folder I want to move the files to is C:\Users\stefa_000\...
0
votes
0answers
67 views

How to loop through files named in a text file? Windows Server 2012

Windows Server 2012 cmd.exe box I need to make a batch file, call it get.bat, to process all directories listed in dlist.txt which is in the same dir as get.bat. Directory names are one per line in ...
-1
votes
1answer
37 views

Difference number of Commands in CMD (Windows OS vs RE)

A couple of days ago I noticed that in Windows Recovery Environment (at boot) there are some commands (bootrec for example) which are recognized when type in the CMD (Command Prompt) but are not ...
3
votes
1answer
44 views

How to get the full path to an executable which is invoked from one of the directories in %PATH%

Let's say I have an executable that I can invoke in Cmd.exe regardless of what directory I'm in because the executable's directory resides in one of the directories specified in %PATH%. So: C:\Users\...
0
votes
0answers
143 views

Focusing a window in cmd with Nircmd

First time posting. I have been playing around with creating macros that can individually adjust the sound of individual application. Found that Nircmd has the commands that I want for example if I ...
0
votes
0answers
36 views

Batch File to see if exe running correct file if not ouput value

I am looking to run a batch file to see if a program is running the file. The filename is the windowtitle. I am new at using batchfiles and figured in the command prompt I can run the following: ...
1
vote
1answer
46 views

save multiple chkdsk logs to single file

I am creating a batch file to run chkdsk on every drive and log the output to a single file. I am able to run a chkdsk and log it to a file with: chkdsk a: > %userprofile%\desktop\test.log ...
1
vote
2answers
62 views

Is there a command to get bash to print a new prompt string and redraw the current line?

Instead of waiting for slow commands to finish, I'd like to run them in the background. However, when they finish running and print to stdout, I get (where █ represents my cursor) this: $ slowcmd &...
0
votes
1answer
38 views

'Net Share' Some shares persistent after /delete

Using Net Share command (as Administrator) I see a list of user shares. However, some of these shares are persistent, and reappear after a reboot despite using the /delete suffix. Why do these ...
4
votes
2answers
179 views

Space in doskey/alias for windows?

I try to run Laravel's Artisan command inside the (docker) container by defining a doskey alias. My idea was: php artisan=docker-compose exec apache php artisan $1 However it does not allow me to ...
0
votes
2answers
92 views

How to duplicate files onto an external backup drive, but first moving existing files to match the source folder tree and get a report?

If the title didn't make much sense then, let me provide more details. My problem is that there are some identical files on both drives already, but they reside in different directories. Let me show ...
0
votes
0answers
74 views

How can I automate multiple Aria2 commands to run consecutively?

I'm trying to execute a command or script that will run a list of aria2 commands consecutively. I've tried writing a bat/cmd file for it but it always provides an error, specifically: [...
1
vote
0answers
85 views

Running Aria2 commands from a bat file

I'm currently using Aria2, a downloading software that you use via cmd, to download a list of content. It requires you to CD to the directory where you have a parameter file that outlines your ...
1
vote
1answer
271 views

use echo and another command in the same line in batch file

For for this code echo x set /p "a=>" result will be x set /p "a=>" The result i want is x> Please help,thanks
1
vote
0answers
61 views

How to launch default browser (e.g. Chrome) through bat script

I have a Chrome (default browser). I also have a bat script where I launch chrome with some flags. chrome.exe --disable-web-security --user-data-dir=c:\dev\chrome-data --disable-features=...
0
votes
1answer
42 views

Windows defrag error Error code 0x89000019

Clean Install Windows 7 64bit, all updates applied Ran defrag from the command prompt and got error Error code 0x89000019 Also logged w windows event error 257 Plenty of Free space. What causes ...
2
votes
2answers
162 views

I get the “SC OpenService Failed Access is denied” error when using an sc config command.

I am already running cmd.exe with the highest privilege. Why am I still denied access? Other commands like sc queryex works just fine. I have not tried using the sc config on other services yet. ...
0
votes
1answer
55 views

Is it possible to run the Windows 10 Command prompt on Windows 7?

I'm running a Windows 7 Machine and wish to use it with my Windows 10 Batch file, however the colored text it uses does not support the Windows 7 Console (see https://stackoverflow.com/questions/...
1
vote
1answer
650 views

Move all the files and folders with CMD (BAT File)

I want to move all the files and folders inside the folder "C:\Foldertest\" into the folder "C:\Foldertest\target". And whenever I run this command, it does this for all files and folders except for ...
2
votes
0answers
25 views

Logon script for Citrix Xendesktop to create shared folder based on IP address

This is a bit over my head, but I've been tasked with writing a script to create a shared folder per login, based on the third IP address octet of the client device, ( thin client terminal). It's ...
0
votes
1answer
109 views

How can I delete all files that have the same extension “.TMP”?

DEL "J:\testing.TMP" The above CMD command will delete a single file: testing.TMP. How can I delete all files that have the same extension .TMP?
1
vote
2answers
51 views

How to copy files with only 1 extension and not double in command prompt

I need to copy only .jpg and not .jpg.jpg from a particular folder. When I do a copy c:\data\*.jpg D:\backup\ both .jpg and .jpg.jpg named files are copied over and I'm not sure how to omit the ...
0
votes
2answers
30 views

.bat script that calls a command, and when it finishes, it waits for user's input

For development purposes, I want a script that just enters in a folder, executes a command there, and when it finishes or fails, waits for user's input, instead of closing the window. Is this ...
0
votes
0answers
28 views

Making bootable USB via XCOPY method not working

I found a method to make a USB bootable via CMD here: Bootable USB flash drive from iso using windows CMD (I can't find the tutorial...) However, my USB did not show up in the boot menu. My ...
0
votes
1answer
417 views

VBoxManage - This app can't run on your PC

How do I run VBoxManage without typing in the full Path? So I've put the VirtualBox folder in my PATH but I still get an error when running VBoxManage or VBoxManage.exe from cmd C:\Users\tom>...
0
votes
2answers
44 views

Different startup directory for every Cmder shortcut?

Say I have 2 Cmder.exe in my desktop Cmder.exe - Shortcut 1 Cmder.exe - Shortcut 2 How can I make shortcut 1 to start Cmder in directory C:\sample1\ and shortcut 2 start in C:\sample2\?
3
votes
1answer
50 views

Is `git` a command in Windows cmd environment?

Assuming I have git installed, does it make git a command in Windows cmd environment? Why is it not in the output list when I run help? And same question for ping command. Thank you
0
votes
0answers
80 views

How can I change values of the `.ini` files via command line? (linux or windows)

How can I change values of the .ini files via command line? (linux or windows) For example I have a php.ini file: display_errors = On error_reporting = E_ALL & ~E_NOTICE Now, I need be like ...
1
vote
0answers
35 views

How to redirect the output of a running process to a log file?

When running a long running task in a command prompt, it's possible to redirect the output to a log file (fe for storage or later analysis). However, I started a few long running tasks this evening ...
0
votes
0answers
124 views

How to select all SessionID in cmd (Wthout Administrator's SessionID)

I can show the active SessionID with the following command: for /f "tokens=2-4" %a in ('"query session | find "Active""') do echo %b While I can show disconnected SessionID changing the searched ...
0
votes
2answers
267 views

batch script to copy files from all available drives to a USB

I have this script for /f "skip=1 delims=" %%x in ('wmic logicaldisk get caption') do ( copy "%%x\*.spt" "%drive%\mydiagtools" ) pause and I need it to copy files with SPT extension (our ...
0
votes
2answers
95 views

Repeating a goto only 15 times

echo off :abc Echo ^ text ^ >> C:/files/text_%random%.txt goto abc How do I do the goto only 15 times?
0
votes
1answer
205 views

CMD Prompt: Allow/Block a SERVICE in Windows Firewall… how to?

Does anyone know the Command Prompt syntax to Allow/Block a Windows Service in Windows Firewall? Research hasn't turned up a certain answer, even from Microsoft's official site. Specifying services ...
1
vote
0answers
252 views

Disable Port from command line (CMD) (Devcon it can not disable a port when there is nothing plug in; I need to do this 100+ PC)

How do I disable this port from command line? Is it possible to disable Port#0005 and only Port#0005?
1
vote
0answers
51 views

script to enable ICS service

I try to build script to select private network and enable part of ICS services. I select the private network with these code: { # Constants $public = 0 $private = 1 Write-Host "Creating netshare ...
0
votes
0answers
31 views

Getting the real path of the current directory when using symlinks [duplicate]

So I just found out that my build fails on the build server (Windows 2008 R2) because the workspace is located on a different drive using symlinks. The build path is C:\Program Files (x86)\Jenkins\...
0
votes
1answer
74 views

xcopy failed to copy

I copied a directory using xcopy /S DIR DIR2 However, instead of a new folder, I got the file DIR2 without any extension, even though it said 86 File(s) copied. Help says that /S also copies ...
1
vote
2answers
66 views

List files in folder that match kind

In Windows Search I can use kind:=music OR kind:=video to get all results in a folder/ subfolders which are that type of media. Is there a way to replicate this with a command like dir on the ...
0
votes
1answer
229 views

What would happen if I increase the ping packet size

I am a newbie to this networking thing and I wonder something that if I increase the ping size to 65.600, how does it affect the internet traffic? ping –1 65500 [IP address]
2
votes
1answer
94 views

Check if registry contains data from .reg file

I have .reg file which was exported on another PC and contains some keys, values and data from different parts of registry. How to check if this keys, values and data are already present on my PC ? ...
1
vote
1answer
145 views

how to close a specific instance of a process using nircmd?

I have been using the following command to try closing the notepad file "temp.txt" opened on the windows. nircmd win close title "temp.txt" But this command seems not to work. If I try the below ...