Questions tagged [batch-file]

batch files are simple text files executed in a command to achieve a particular task or a set of tasks

batch files are text files containing commands executed in sequence to achieve a particular task or a set of tasks. They can be very simple, or can contain complex logic.

440 questions
1
vote
1 answer

For in batch has weird behavior while reading folders

Im trying to do a simple batch (it is not the whole thing, but that's the part that is making everything fail) @echo off for /f "tokens=*" %%G in ('dir /s /b /a:d "e:\tmp\*"') do ( echo %%G set fullpath=%%G set basename=%fullpath:~7% …
1
vote
1 answer

Running multiple instances of a Batch file in windows simultaneously?

I have a windows batch file that is invoked by windows scheduler. When I try to have multiple windows scheduler tasks trying to run the batch file simultaneously, the batch file is locked by the first process and the all the other instances fail. Is…
1
vote
3 answers

How to pass parameters to a bat script

Excuse my newbie question but I haven't had to touch bat scripts since the days of the autoexec.bat... and that one was even called from the system directly. So I wonder how I can pass in arguments to my bat script? For example I want to create n…
raoulsson
  • 4,763
  • 10
  • 34
  • 29
1
vote
1 answer

ftp batch file invalid login

I am trying to create a simple ftp batch file to upload a handful of files on a regular basis but I cannot seem to get the login right. I can take the same credentials and log in through Filezilla without issue but from the command line it's not…
JohnDoe
  • 183
  • 3
  • 16
1
vote
2 answers

iis 7.5 Website permissions

I'm trying to setup permissions on IIS 7.5 running in Win7. The instructions I found are: Ensure all your sites have their own unique Application Pool assigned. In the Advanced Settings under Processing Model for the application pool, set the…
Docfxit
  • 11
  • 4
1
vote
4 answers

Prevent Accidental Execution of Windows .BAT File on Workstation?

I have a .BAT file with a robocopy line in it. The .BAT file resides on a network server directory. I use a client/monitor application on my workstation to send out a run command to several headless machines to tell them to each run the .BAT…
JamesHoux
  • 257
  • 1
  • 3
  • 8
1
vote
1 answer

install software with logon.bat script

On an SBS2011 server I can see in AD that users have logon.bat in the Log In Scripts field of their profiles, but when I search the hard drive of the server I can't find logon.bat. Firstly, I assume I just need to create it. Where do I store it so…
Reece
  • 783
  • 2
  • 13
  • 32
1
vote
2 answers

assign batch jobs with one processor for each

I have four bat files and a four core machine. Is it possible to assign each run to each core i.e. 1 job for 1 core. Is there any way to control this with commands?
user741592
  • 111
  • 2
1
vote
0 answers

Display only the last line of a windows command line executable

I'm trying to write a batch script that manages simple software deployments. One of the steps in the script compresses a file structure into a 7zip archive. During the compression process, the z7ip command line application outputs the current file…
1
vote
2 answers

How to do some actions for each file in a folder?

I have a folder with files having .foo extension. I need a batch file to execute some commands for each file in that folder having that extension. How should i do that? Seems I need a loop after getting the file list but I don't know how to do this…
Klaim
  • 215
  • 2
  • 8
1
vote
1 answer

Pentaho Windows Batch file not running when executed on Windows Server 2008

I'm running a Pentaho Kettle Kitchen batch scripts on Windows Server 2008. When I launch the batch file, the Windows Command prompt pops up and then disappears. I've changed all files in the folders being accessed to non-read only and gave full…
1
vote
3 answers

7zip logging & left-over .tmp files

I have a batch file that runs nightly to compress some PST's, it uses 7zip & generally is pretty successful. However it tends to create left-over .tmp files (9 over 2 days), I want to delete these. According to multiple 7zip forums, patch requests,…
gregg
  • 629
  • 4
  • 11
  • 26
1
vote
2 answers

RoboCopy A File From The Web?

Is it possible to download a file from the web using RoboCopy? What would the syntax for that be? Here's what I'm trying: RoboCopy "http://www.google.com/" "C:\some_folder\" "index.html" /L /V /E /LOG:"C:\some_folder\test_robocopy.log" /R:10…
Cory Dee
  • 121
  • 1
  • 2
  • 8
1
vote
1 answer

Joining an Active Directory domain using netdom

I have a simple script to join an AD domain and rename the computer. When I execute these commands directly on the CLI, it works fine. When I execute the same via batch file, I get an error saying The network path was not found I am running as…
1
vote
2 answers

How to use date functions for linux batch specile?

First, I wasn't sure if belonged to StackOverflow or here, but figure this would be more applicable to server administration. We have a .tar backup file going to an offsite backup server each day as apart of our daily processing. These are…
Chad Harrison
  • 6,990
  • 10
  • 29
  • 41