Questions tagged [batch]

A batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter under MS-DOS and Microsoft Windows.

This was the first extension used by Microsoft for batch files. This extension runs with MS-DOS and all versions of Windows, under COMMAND.COM or cmd.exe, which execute its commands, normally line-by-line.

339 questions
2
votes
4 answers

How can I hide ms-dos window when running a .bat file?

I am running a .bat file for my script (Scheduled Tak (CronJob)) per minute. When it run, seems ms-dos window short period of time. My batch code like this; @ECHO OFF C:\wamp\bin\php\php5.4.3\php.exe -f "C:\wamp\www\tst\index.php" How can I hide…
prestack
  • 35
  • 1
  • 4
2
votes
1 answer

How to dump certificate file from installer via command-line?

I'm building a script that will download and install a bunch of programs. One of those programs depends on a virtual driver, which needs its certificate to be imported in order to function. Normally, the installer does this for you in the GUI and…
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
1 answer

How does the "Last Result" column of Scheduled Tasks in Windows Server 2003 get set from a process or script?

The Last Result column of the Scheduled Tasks Window on Windows Server 2003, displays the result of the execution of the .exe, .vbs, .ps1, .bat, .cmd, etc... that has been run at the scheduled time. There is also an archived history of this value…
leeand00
  • 4,869
  • 15
  • 69
  • 110
2
votes
4 answers

What is the efficient way to backup large files?

I have the schedule job of backing large files in Windows Server and it takes almost 2 hours to finish. For now, I only use copy command in the .bat and copy the large files to another folder. I'm wondering whether there is more efficient way than…
macemers
  • 131
  • 5
2
votes
3 answers

Using a for loop in Microsoft cmd.exe, how can I process only the files with a certain extension?

I have a the folder c:\test\ and two files in it a.txt and b.txtv. I would like to process just the files with extension equal to .txt. If I write this commands cd c:\test for %f in (*.txt) do echo %f I will get the result where both a.txt and…
2
votes
1 answer

How do I run bat file inside cmd using tash scheduler

How do I run bat file inside cmd using tash scheduler. I've tried this one C:\windows\system32\cmd.exe C:\synchronization.bat And doesn't working.
infaustus
  • 133
  • 4
2
votes
2 answers

Change windows group permissions without the sufficient rights in a batch

I wrote a batch file, which creates multiple folders und subfolders in the current directory. The group permission of one folder is also changed. This works on my local workstation with administrator privileges, but it doesn't work on the server,…
2
votes
3 answers

delete all folders with tmp in name using batch file

Have tried to google this, but I always seem to get results relating to .tmp files, which isnt really any use. I have only a basic understanding of batch files, but I think I need something like this: rmdir "D:\*.tmp" Windows update seems to be…
James Edmonds
  • 1,733
  • 10
  • 37
  • 59
2
votes
3 answers

I need to clear out the same directory on multiple servers across a network. How do I do this?

On multiple (about 20) servers, there exists the same directory C:\Deployments. This directory has multiple subfolders which contain more subfolders and files. The C:\Deployments directory itself does not contain files. I have a batch file that,…
blashmet
  • 19
  • 2
2
votes
1 answer

I'm having trouble finding these commands to run in a batch file?

I want a batch file to pull information from the first line of a text file (notepad), use that information to add information to a DNS server, and then delete it. I'm thinking if I create a loop, I can make it go all the way through the text file,…
2
votes
1 answer

Dos Batch File Help: Storing %%c variable from FOR loop [Resolved]

It's been a while since i've had to write a batch file, and i'm having trouble with the following: @echo off SETLOCAL ENABLEDELAYEDEXPANSION for /f %%a in ('dir f:\*mssql* /ad/b') do ( for /f %%b in ('dir f:\%%a\data /ad/s/b') do ( for…
David W
  • 91
  • 1
  • 7
2
votes
3 answers

How to automate FTPS uploads from the Windows Command Line

I'm looking for a batch script to automate the upload of MULTIPLE files at a time to an external ftps site (ftps://servername.xxxx.com).The files are located in a folder on a Windows Server 2008 system.If possible the batch script also needs to…
ciscokid
  • 53
  • 3
  • 7
2
votes
1 answer

How can I use a batch file to dump only the last few weeks' revisions in SVN?

We were previously backing up our full SVN dump each night, but the repository has now become too large. If I was willing to cut off the revision history at say 2 weeks, how would I go about making a batch script to perform this dump? I realise…
PLC
  • 23
  • 1
  • 3
2
votes
1 answer

Rename folder using wildcard windows

I've got a piece of software that includes its own backup utility, but it generates folder names with the current date and time appended. I'd like to write batch script that will remove the date/time part of the folder name essentially I'd like to…
sandyscott
  • 213
  • 3
  • 7