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
0
votes
2 answers

For Loop in batch file

Expected Input: Start=1, End=500, Interval=100 Expected Output: 1, 100 101, 200 201, 300 301, 400 401, 500 @echo off set start=1 set end=500 set interval=100 for /L %%g in (%start%, %interval%, %end%) do ( set first=%%g set /a last=%first% -1 +…
Vinayak Dornala
  • 111
  • 1
  • 3
0
votes
2 answers

Checking file properties in a batch script?

I have a batch file from a vendor to patch some software on a Vista machine. I'm going to be using GPO to push it out as a startup script. My problem is some systems require this software and some don't. I'd like to add code to the beginning of the…
MathewC
  • 6,957
  • 9
  • 39
  • 53
0
votes
2 answers

How to run batch file without a window in ONE file

I know how to run batch files without a window thanks to this question here: Run a .bat file in a scheduled task without a window. The first answer is the one I am using. It states that to run a batch file without a window, create the following vbs…
0
votes
1 answer

How do I give a program permission to change the system time in windows 7?

I have a some software which requires that the windows system time be synchronized with a physical atomic clock* before a certain procedure begins. Right now the user has instructions to modify the time using timedate.cpl before they begin. I would…
chriskelly
  • 576
  • 6
  • 11
0
votes
1 answer

I am unable to set the owner of a folder back to the user from my bat file

The following bat file is being used to fix permissions for Users in our organization. Everything works perfectly until we try to set the owner back to the user. takeown /F F:\Users\First.Last /R icacls "F:\Users\First.Last" /grant:r…
software is fun
  • 306
  • 3
  • 6
  • 14
0
votes
1 answer

Creating batch files from txt files - is this right?

Forgive me if I am completely of the rails here, but.... I am just learning about Group Policies and Domain Controllers etc. and I have a some .bat files, now I can edit them in notepad or any text editor. So if I output commands say from database a…
Jeff Kranenburg
  • 149
  • 1
  • 1
  • 10
0
votes
1 answer

How to catch system events when a program is being updated and robotize routine steps when you update software?

I'm a support engineer for an accounting program. The program runs under Windows. I have to update many of this accounting software bases daily. I mean the software is always the same. But users may have, say, 50 informational bases installed. Each…
0
votes
2 answers

Install RSClientPrint for Reporting Services 2012 using .bat file and still be able to use 2005

I have a Reporting Services 2005 server that when users accessed it and tried to print reports would get a message asking them to install the print control, which they could not do because of lack of permission. A work around I had found at the…
John Wesley Gordon
  • 183
  • 1
  • 3
  • 10
0
votes
0 answers

Error: "Parameter is incorrect" when opening 0b bat/cmd

Having sort of issue that is more likely annoying when need to create short batch script (though it's not scripting issue). I want to right-click on desktop and create new text file. Rename it and make it's extension as .bat (or .cmd). Since this…
0
votes
1 answer

Batch file output issue

I am trying to get a batch file to output some data to a CSV file. The command I have works perfectly in the command line but not when I copy it to a batch file. In the batch file, it just hangs and keeps looping. Here is the command: getmac /fo csv…
0
votes
1 answer

Batch script works on Windows 7 but not Windows Server 2008

Good Day Al I have the following batch script that loops through a folder containing .sql files. When it finds a .sql file that has today's date timestamp on it, it copies that file to a new directory. @echo off setlocal enableextensions…
0
votes
1 answer

Tools or scripts to transfer files of a specific criteria to a USB drive

The company I work for has a 'company wide' share that is mapped on all of our machines. Over the years this has grown into the terrabytes and now lucky me has been tasked with bringing this back under control. I'm looking for a robust…
James
  • 103
  • 3
0
votes
1 answer

Query in dsrm command

I need to remove 1000 computers from AD. I tried the script below, but it's not working. When I used dsmod to disable computers, in the same script, it works. @echo off set ComputerList=C:\Users\a058059x\Desktop\Machines.txt for /f "delims=" %%a in…
0
votes
1 answer

Batch script - How to release a locked file for batch 'copy'

A daily windows scheduled task triggers a batch script which moves program files to a folder on a server, using a simple copy routine. rem deploy programfiles copy dailybuild\*.dll "\\myserver\programfiles" /Y copy dailybuild\*.exe…
Kman
  • 101
  • 2
0
votes
0 answers

"-STA -WindowStyle Hidden" Option not working with citrix

i have a powershell application published to citrix. It simple executes a remote batch file Initiator.Bat which then executes apowershell script with following command, Powershell \\server\Taskpad\Script.ps1; then user gets a credential…
Darktux
  • 827
  • 5
  • 21
  • 36