Questions tagged [windows-command-prompt]

Refers to the default CLI that ships with all versions of Windows, often shortened to just "command prompt" or cmd (after the file name of the executable).

Refers to the default CLI that ships with all versions of Windows, often shortened to just "command prompt" or cmd (after the file name of the executable).

383 questions
2
votes
1 answer

dsadd run from batch file fails with "The specified account already exists" when there is no existing account with the same dn

I am programmatically creating thousands of test users from a txt file containing First Name, Last Name, Username, and Password using the following command (saved as a batch file, run in cmd, modified from this question): FOR /F "tokens=1,2,3,4…
2
votes
1 answer

How to remove directories using wildcards by reading a file using batch?

Batch file for /f "delims=" %%f in (7profiledeletelist.txt) do rd /s /q…
serdar
  • 127
  • 7
2
votes
1 answer

set unlimited lease duration throuth CMD

On Windows Server 2008 (R2, 32-Bit, I found the following way to set the lease duration for, say, 3600 Seconds (1 Hour). netsh dhcp server scope 10.0.0.0 set optionvalue 51 DWORD 3600 [→ source] This is based upon RFC 2132 where optionvalue 51…
2
votes
2 answers

Properly escaping a path with spaces in CMD shell

I have the following path: "d:\workspace\Server trunk - CI\make\make & publish.bat" However, when I try to execute this from a cmd shell, I get the error: 'd:\workspace\Server' is not recognized as an internal or external command, operable…
Igal Tabachnik
  • 405
  • 1
  • 5
  • 11
2
votes
2 answers

Batch file to call multiple batch files and keep going after errors

I have a batch file like this, the issue that I have is that if the first batch file fails, the second one never gets started, how can I get them to both keep going? @echo off MapNetworkDrive_J.cmd MapNetworkDrive_Y.cmd I have tried this: @echo…
Nate
  • 2,151
  • 6
  • 26
  • 41
2
votes
1 answer

Networking ARP table in windows cmd

I am reading the book practical packet analysis and I have just learned the fundamentals of the ARP protocol. They also added something about the arp -a cmd command. I'm curious about some of the extra addresses, and I can't find much information…
AEGIS
  • 21
  • 1
  • 4
2
votes
1 answer

Command Line Script Issue

I've been working on a batchfile script for a few weeks now that should automate certain routine tasks I need to perform during my work. However, I've stumbled upon a problem which I haven't been able to figure out yet. I'm using a USB Stick that…
2
votes
0 answers

Trying to run a netsh batch with foreign characters

I am trying to run a batch file with the following content: netsh interface ip>set dns "Połączenie lokalne" source=dhcp The file is saved as ANSI. My Windows codepage is 1250, the OEM one 852. Thus, since Windows uses ANSI (ACP) while the console…
Tin
  • 21
  • 1
2
votes
1 answer

Weird issue with .bat script

I have a .bat script which instals 3 pieces of software. When i open an elevated Command promt , browse to the file and run it everything works fine. When i run the .cmd directly ( using the 'run as administrator' from Windows 7 nothing happens. any…
NickDa
  • 87
  • 1
  • 2
  • 5
2
votes
0 answers

Access Denied error when running xcopy in jenkins on windows 2008 r2

I have installed Jenkins on a Windows Server 2008 R2 and in the build script i use xcopy to copy the generated war file to a specific folder The problem I am having is that every so often the build fails when run xcopy showing access denied and…
2
votes
2 answers

How Can I Create Multiple Files of a single file in multiple Directories?

Hello I am trying to create multiple copies of a single file in multiple directories? for example I have 6 folders with a single file in each folder named lp.html, How can I run a batch to create 100 copies of said files in each directory. The code…
2
votes
2 answers

Extend time range to shutdown command

Is it possible to extend the valid range to the DOS shutdown command in Windows Server 2003? The help shows a maximum time-out period at 600 seconds.
ITAlin
  • 57
  • 8
2
votes
1 answer

Batch - how to copy file by minimum size and date modification?

I have this simple batch script which copies the newest file in some dir to another place. I want this script to also ignore all files (in the DIR command section) under 1GB of size. FOR /F "delims=|" %%I IN ('DIR "Y:\DEVL\*.*" /B /A-D') DO SET…
Yoffe
  • 53
  • 2
  • 7
2
votes
1 answer

Checking .BATs exit code with NAGIOS?

I currently have the following script on a Windows Server: @echo off set path=%PATH%;C:\UnxUtils\usr\local\wbin cd /D Z:\videos forfiles /M *_1.mkv /D +%date% > C:\mkv.txt >NUL 2>&1 FOR /F "tokens=*" %%B IN ('grep -c _1.mkv c:\mkv.txt') DO SET…
Kevin Maschke
  • 97
  • 1
  • 7
2
votes
2 answers

Windows cmd stderr redirection to stdout while keeping output to stderr?

Is there a way in Windows 7 cmd shell to redirect the stderr to stdout while keeping the stderr stream intact? For example, I have a program that outputs to stderr and stdout the following message TO STDOUT TO STDERR I want to have two files…
Stecy
  • 122
  • 1
  • 2
  • 6