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

0
votes
1answer
1k 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
806 views

I Cannot create a .BAT file in the root of C “Access is Denied” Server 2k3

I have an oracle db server on a windows 2k3 box. I am currently unable to create or copy a batch file to the root of c. I can create batch files on different folders (i.e. in my user directory) or I ...
1
vote
0answers
22 views

How do I script a change to the msmq storage location on Windows 2008 R2 server

Is there any way of doing this through a batch or powershell script? I'm looking for a way to set up several new servers. The only thing I found on the subject leads me to believe you cannot: from ...
-4
votes
1answer
33 views

bat file to create a list of folders in the current folder

Lets say I have a folder c:\myfolder in Windows7. Also, there is a file source.txt that contains a list of relative paths such as \myfolder\bat\ \abc\123\jjj \xyz\ and so on I would like to run a ...
2
votes
2answers
4k views

How can I reset settings for Internet Explorer using a script?

I'm looking to reset Internet Explorer back to factory defaults using a batch file. I'd also like to delete: all Downloads, History, Cookies and Cache, plus anything else in a user's IE profile.
3
votes
0answers
48 views

Batch script is not getting executed when called by Start-Process Cmdlet

I have a strange issue on a Windows Server 2012 R2 here that just does not make any sense to me at all. I've got a PowerShell script that basically has the following structure: Function ...
0
votes
1answer
31 views

Clear Windows Temp Folder - Without listing or counting files first

We have a Windows Server 2008 machine running as a web server. We noticed a problem with one of our PHP based websites today, and the error message related to the session and access to the Windows ...
1
vote
2answers
2k 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
2answers
64 views

For Loop in batch file [closed]

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%, ...
4
votes
1answer
133 views

How to get login username of the login that triggerred a task in the task scheduler

In the Windows 7 task scheduler, I have a task that runs when any user logs on. This task is run as Administrator so it can get the proper priviliges and runs a bat file. I would like to pass in the ...
1
vote
1answer
180 views

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

I have created a batch fill which will block Facebook by amending the hosts file in this location: C:\windows\system32\drivers\etc\hosts This is the contents of the file: @echo off echo ...
1
vote
1answer
15k 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). ...
2
votes
1answer
142 views

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 ...
13
votes
9answers
93k 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 ...
2
votes
1answer
99 views

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 "%%f" PAUSE exit 7profiledeletelist.txt C:\Users\1* C:\Users\2* C:\Users\3* C:\Users\4* C:\Users\5* C:\Users\6* C:\Users\7* ...
0
votes
2answers
118 views

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 ...
1
vote
2answers
961 views

slmgr.vbs supress dialog

We use a batch file with the following content to activate our windows domain computer after imaging: slmgr.vbs -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX slmgr -ato This works well, but there is a ...
0
votes
1answer
1k views

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 ...
0
votes
1answer
436 views

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 ...
-3
votes
1answer
46 views

Install .EXE without displaying windows [closed]

I want to install an .exe file without displaying windows, by supplying value to parameters ? How can i do from Commands or script not in UI ?
0
votes
1answer
48 views

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 ...
-1
votes
1answer
213 views

Best Practices for User folder permissions [closed]

The following is my bat file. Is there a way I can substitute First.Last with usernames from a CSV file? My boss doesn't want to do all the users at once. He's afraid that something may happen so he's ...
1
vote
1answer
172 views

Task to delete a directory runs with success but the directory is still there

I have a task in the task scheduler on a Windows 2012 file server. The task has to delete the contents of a temporary general access directory every Sunday night. It runs at the scheduled times and ...
10
votes
9answers
19k views

Elevating UAC via .bat file?

Pretty straightforward one that I'm having trouble finding an answer to. serverfault previously helped me with finding a way to automate Windows updates without using WSUS. It's working ...
0
votes
0answers
91 views

Getting the `The application failed to initialize properly`/3221225794 error executing a batch file

There is a scheduled task that is attached to a custom event in the EventLog, it executes the lines below: reconnect.cmd c:\windows\system32\rasphone -f "phone_book.pbk" -d "vpn_connection" ...
0
votes
2answers
63 views

Block users from Remote Desktop for a specified period of time or by trigger

So I have to server (2003 & 2008). On both servers I have domain users in a Remote Desktop Users group. They need to rdp to the server and work with some apps and log off. But - every day batch ...
10
votes
6answers
420 views

50 workstations, 1 .bat file on a network server, will it work?

I have a .bat file to perform maintenance on machines. I put the .bat file on a network attached server for all workstations to access it. If I were to use the windows scheduler to make that .bat ...
0
votes
1answer
66 views

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 ...
31
votes
3answers
70k 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?
0
votes
0answers
95 views

Handle.exe creates Handle64.exe & hangs thereafter

On windows server 2008 R2 ,In a folder I have handle.exe along with psexec.exe and a batch file name test.bat with following content: psexec -s D:\data\handle.exe -p taskhost.exe > ...
1
vote
0answers
37 views

Losing stdout when process restarts itself in windows

I have for example a NodeJS process running with Nodemon, and all the output redirected to a file. nodemon example.app > 123.log When I change any file in the node app, the NodeJS process is ...
0
votes
1answer
28 views

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 ...
12
votes
4answers
42k 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 ...
2
votes
2answers
2k views

Scheduled task fails, but runs fine when triggered manually

We have a 2008 R2 server with a scheduled task that runs a .bat file which executes a call to a Java app. The task triggers just fine, but stops executing anything after it creates the log file. ...
0
votes
1answer
689 views

Why is execution of batch files different between drag & drop and from command line?

Ok, so I've been trying to figure this out for hours with no progress. I have created a batch file to get details of a VHD. Everything runs fine and produces the expected results when run from the ...
0
votes
0answers
266 views

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 ...
1
vote
1answer
60 views

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 ...
1
vote
1answer
288 views

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 ...
-1
votes
2answers
96 views

Desktop backups maintenance on a network share

I have configured Windows Backup and Restore function on Windows 7 Professional desktops to make daily backup on a network share placed on a Windows Server 2012. (BTW It's a pity that this utility ...
2
votes
1answer
1k 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
67 views

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 ...
1
vote
1answer
217 views

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 ...
2
votes
1answer
178 views

PsExec hangs intermittently when calling AppCmd

We have an automated deployment process which is primarily managed by a batch file. One of the first steps in that process is to stop an IIS AppPool so the updated files can be safely copied. To do ...
1
vote
2answers
105 views

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 ...
3
votes
9answers
5k 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
2answers
428 views

Stopping a scheduled task with WMIC

I need to find some method for disabling a scheduled task on a remote machine and waiting until that task has stopped executing if it happens to be running at the moment. I'd like to do this through ...
0
votes
1answer
210 views

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 ...
0
votes
1answer
111 views

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 ...
0
votes
1answer
27 views

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 ...
2
votes
1answer
148 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 that I need ...