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

learn more… | top users | synonyms

6
votes
1answer
3k views

Is MSIZAP still useful, or is it obsolete?

I update flash using MSI files installed by group policy. However, with every update, about a third of the workstations fail to update (Windows Vista and Windows 7 32/64-bit editions). In the event ...
1
vote
1answer
28 views

How can I confiuger a windows service from the command line

I have a windows service that I've written. I'd like to make it easy for my server team to install it. So I'm building a little batch script. One of the things that I require is for it to be setup ...
0
votes
2answers
10 views

Win2012r2 Services Recovery Tab documenation refuses to launch

Services Recovery Tab Help will not launch. [ On the "Recovery" tab in Windows Services.msc, clicking on "Help me set up recovery actions" results in "An internal error occurred (...
0
votes
0answers
44 views

Start/Stop services using bat file in Windows server 2012

In our old 2003 server, we were able to start and stop services by using a bat file(with net stop and net start commands). When ever the services stops(MQ listner services), we force start an autosys ...
1
vote
2answers
650 views

Batch File to Automatically Install List of Drivers without User Interaction

At work, one of the tasks I am responsible for is resetting computers to their factory settings and installing the updated drivers. Lenovo makes this easy with their System Update tool, but Dell and ...
1
vote
2answers
2k views

Server 2008 issue running batch file

For the life of me, I can't seem to get a batch file running in Server 2008 Task Scheduler, despite it not having the common problems I've seen before. Problem so far: I have a batch file that ...
0
votes
2answers
34 views

Install Application using a batch file [closed]

I work at a company and I have to write a script that silently installs applications to thousands of users. I know how to do that but the only problem is this specific application has certain things ...
0
votes
3answers
56 views

Batch file error when executed from Task Manager

I'm new to windows batch scripting, but I was able to get something working that I needed. It works when executing it manually, but when Task Manager executes the script, it doesn't complete. The Last ...
1
vote
1answer
105 views

Rename files to add date modified to filename with Windows CMD or simple .TXT

I am attempting to rename a large batch of files to incorporate the dates in the "Date Modified" column from File Explorer into each filename in YYYYMMDD format. I was able to generate a report from ...
2
votes
2answers
8k views

Creating a service to run RoboCopy

I'm attempting to put together a batch file that will set up a robocopy task as a service in response to user input. The basic idea being that the user will input MyRobocopyBatchFile.bat sourceFolder ...
0
votes
1answer
207 views

Do CMD scripts run faster than BAT scripts?

I recently heard from someone that Windows Admins should use CMD logon scripts over BAT logon scripts, as the run or execute faster. Apparently BAT scripts are notoriously slow. I've done a bit of a ...
0
votes
3answers
38 views

Run Log-on Script with Admin Rights

I created a batch logon script that checks and removes old versions of a specific piece of software and installs the newest version. Both the install and uninstall process use an .EXE file. The script ...
1
vote
2answers
1k views

command line REGEDIT command (edit) without a popup

I am attempting to disable UAC via a batch file with a REGEDIT command, and everything works - but, I need to be able to do this without clicking. When I run the: REGEDIT /S somefile.reg It works ...
2
votes
2answers
101 views

Start /wait in batch file stops waiting after ~5 minutes

I need to copy some large sets of files from one server to another (DICOM imagesets). I've written a batch file to automate the process. The batch file reads a text file with a list of cases to copy ...
5
votes
4answers
7k views

Correct technique to find application in 32 and 64 bit versions of Vista/Windows 7 from CMD.EXE

BACKGROUND I have an existing CMD script that works fine. It launches an app from PROGRAM FILES like so "%PROGRAMFILES%\MyApp\app.exe" PROBLEM it works fine on 32-bit versions of Windows (Vista, ...
0
votes
1answer
97 views

how to Install java run-time /jre on a custom path using a Batch script?

Im trying to create a bat file to make an unattended installation with sccm. I downloaded jre-7u55-windows-i586.exe from http://www.oracle.com/technetwork/java/javase/downloads/java-archive-...
2
votes
3answers
34k views

Can I Deploy a batch file with Group Policy to run as administrator?

I have created a batch script which will block Facebook by amending the hosts file in this location C:\windows\system32\drivers\etc\hosts This is the contents of the batch file: @echo off echo 127.0....
0
votes
2answers
40 views

Copy folders to network directory

I'd like to copy C:\users from every client's computer to a network share \\. Reason being we need to take backups of this folder and its contents prior to maintenance. Is it possible to achieve this ...
0
votes
1answer
55 views

Is there any way to add an HTTP Header to every IE request on a computer?

I would like to add a custom HTTP Header to every Internet Explorer request on a computer (or every browser request). I don't know if this is possible whatsoever, if you have heard of anyway to ...
1
vote
2answers
44 views

windows - how to make some file impossible to remove/rename for all users via commandline

how to (using command-line/batch file only) make some file impossible to delete/rename for all users. I tried attrib +R on file itself and on directory where it exist but it doesn't help
3
votes
9answers
7k views

what is good way to protect batch file?

I have batch scripts that are scheduled to run daily. Some of the scripts have password in them. I'd like to protect the batch from being read or opened by those not authorized to open or read them. ...
3
votes
1answer
426 views

batch - File last modification time with seconds

I want to know when a file has been modified for the last time. I can get these infos using the following batch script: FOR %%i IN (myfile) DO SET modif_time=%%~ti The problem is how to get the ...
1
vote
1answer
80 views

How to catch “The system cannot find the file” within For /F loop?

How to catch "The system cannot find the file" within For /F loop? I would like my code to do the following: 1 - Search for the specified file 2 - If file not found, handle the "The system cannot ...
1
vote
1answer
26 views

copy file with date appended

I am writing a script that copies files to another directory. I wanted to append the date to the end of the file but when I try to use %date% I get the following: copy c:\mydir\file.zip "c:\temp\...
0
votes
0answers
37 views

Windows Server 2012: Dump local security setting to a txt file

Is it possible to dump the local security settings to a txt file using PowerShell or a batch script?
1
vote
3answers
30k views

Script to delete temp files for all users in XP, Vista, and 7

Basically, we have numerous customers running XP and 7 with a few Vista machines. I've found this batch script, but it is limited to the current user (uses the %userprofile% environment variable). I'...
3
votes
1answer
5k views

Running a Batch File from Task Scheduler Without User being logged In

I'm trying to run a batch file on Windows 7 from the Task Scheduler. I can run the batch file fine if I run it from the command prompt. If I run it from the Task Scheduler to only run when the user ...
0
votes
0answers
60 views

Windows Update on multiple servers

I have about 500+ servers( Win 2003, 2008, 2012). At the moment patches are set to available by SCCM. We need to login to the servers and download n Install the patches. Once it done we restart the ...
-2
votes
1answer
28 views

Batch file to autorun when computer is inactive

As the title says, I want a batch file to autorun when the computer (mouse, keyboard, etc ...) are stopped (inactive) for at least 3 minutes. Help?
1
vote
1answer
69 views

how can I download web pages from the command line in windows

Well, I'm trying to do some automation using batch file to speed up my daily routine at work, and I need to solve these little questions: I want to install wget command, but using only the pure ...
1
vote
1answer
102 views

WMIC Command works, but doesn't work in powershell script

#Get Data Rate wmic "/OUTPUT:'C:\Users\user\Documents\DATE RATE\Data_Rate-ts8"+".txt" nic where 'NetEnabled = True' 'get Name,MacAddress,Speed'" Running this in the console directly works. That is ...
0
votes
1answer
36 views

How to change AWSTATS configuration via cli

My Apache log files have the date included in the name and I can't change this. Is there a way to change the LogFile config parameter for AWSTATS using Windows CMD prompt? Better yet a batch script? ...
11
votes
8answers
40k views

Batch file to uninstall all Sun Java versions?

I'm setting up a system to keep Java in our office up to date. Everyone has all different versions of Java, many of them old and insecure, and some dating back as far as 1.4. I have a System Center ...
1
vote
1answer
5k views

Executing Windows administrative shell commands on Windows using Python

I have a batch script using Windows shell commands to perform several administrative actions. The script is running great on Windows 7 but when i try launching it from Python 2.6 nothing happens: ...
77
votes
3answers
164k views

How to sleep in a batch file?

How to pause execution for a while in a Windows batch file between a command and the next one?
1
vote
0answers
1k views

Clearing Out SCCM Cache On Client Machine Automatically

I would like to run a script that clears out the SCCM cache on a client computer automatically. To do this, I have written a simple batch file: if exist %Windir%\ccmcache ( RMDIR %Windir%\...
1
vote
1answer
254 views

Run Bat file in Administrator Mode in Windows Server 2008

runas.exe /profile /user:administrator "C:\temp\SQLSP3.bat" will run the SQLSP3.bat file in Administrative Prompt and it is asking Adminstrator password in Windows Server 2008. SQLSP3.bat file has ...
1
vote
1answer
210 views

How to auto-run batch file as specific user (not scheduled task, not a duplicate)

I am an enterprise admin (Sr. Network Engineer), but my team does not manage Active Directory, so I am a little unfamiliar with policies and what is required to do what I am trying to achieve, and ...
1
vote
1answer
12k views

How to write a dos batch script to create a folder structure?

I would like to be able to have a dos batch script that I could utilize to create a specific folder structure below what ever directory I may be in at any given time. The specific folder structure ...
1
vote
0answers
38 views
23
votes
5answers
110k views

How do you wait for an exe to complete in batch file?

I'm trying to create a script to execute an exe on shutdown in order to install sp1. my script goes something like (not actual bat script). If installed GOTO END Install.exe END: My problem is ...
18
votes
10answers
145k views

How to create a service running a .bat file on Windows 2008 Server?

I've created the service using sc create myService binpath=myservice.bat But when I start it, it fails with the following error message: [SC] StartService FAILED 1053: The service did not ...
1
vote
0answers
30 views

DSADD in batch file - syntax incorrect! Same command in command works fine

Really stumped here and I'm sure the answer is simple. Simply put, I'm creating a bunch of AD accounts based on input from a spreadsheet. I've been able to concatenate the fields into a DSADD command ...
1
vote
1answer
78 views

Is there a way to run a script file that searches for files BUT excludes hidden files and folder?

I need to search some windows servers for files created after a certain date. I have set something up with forfiles but would like to speed up the process and reduce file size of the output file by ...
3
votes
2answers
21k views

How to uninstall software using batch file

I want to uninstall a software by calling a bat file. It must be automatically, without entering any parameters during the uninstallation. How to make the bat file which would be able to uninstall ...
2
votes
3answers
6k views

Can't run batch files from server, Users do not have permission to access file

We're trying to run some logon / logoff scripts on server 2008r2 domain controller. The script is located in the default group policy logoff directory \\domain.local\SysVol\domain.local\Policies\{...
0
votes
1answer
59 views

Wbadmin [startbackup] keeps prompting for password

I am running Wbadmin for backup purposes in a batch file, however the batch execution halts, prompting for a password although the password is provided. First attempt - include password in command: ...
1
vote
4answers
4k views

net use mapping not working in batch files but works in cmd

Ok so here's the problem : I've got users using logon script in the domain (username.bat). The script simply lists 4 or 5 (net use letter: \\SERVER\directory\). However, when they open their session, ...
0
votes
1answer
74 views

How to rar the newest (The latest modified date file) file?

I have the folder c:\AA\ that everyday there will be a new BAK file. When I run the command it will re-rar every files not just the newest file. I use this batch code: FOR %%A IN (C:\AA\*.txt*) DO "...