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

1
vote
0answers
20 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 ...
3
votes
0answers
47 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 ...
0
votes
2answers
63 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
169 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 ...
2
votes
1answer
141 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 ...
2
votes
1answer
98 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
115 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 ...
0
votes
1answer
424 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 ?
-1
votes
1answer
211 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 ...
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 ...
0
votes
0answers
90 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" ...
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 ...
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 ...
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 ...
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 ...
0
votes
1answer
688 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
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
0answers
265 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 ...
2
votes
1answer
999 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 ...
1
vote
1answer
216 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 ...
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 ...
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
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 ...
3
votes
2answers
425 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
209 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 ...
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 ...
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 ...
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 ...
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 ...
5
votes
0answers
232 views

Windows Task Scheduler cannot access EFS encrypted folder despite running as a user with access

I have a batch file set to run via Task Scheduler in Windows Server 2008 R2. The batch file is being used to rotate and compress MySQL logs, and the folder containing these logs is encrypted using ...
1
vote
4answers
197 views

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

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 ...
0
votes
0answers
86 views

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

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 ...
2
votes
5answers
424 views

How would you run an application off a network share so you can update application?

We have an internal desktop application which we have deployed to a network share. In that directory are subdirectories for each version, ie, z:\Apps\ApplicationX\1.0 z:\Apps\ApplicationX\2.0 ...
0
votes
1answer
218 views

Windows Login straight to Terminal Server

Essentially I'm looking for some way via batch (or potentially powershell, but win XP machines so ideally batch) to open up a RDP connection to a LAN based Terminal Server upon a user logging into a ...
-1
votes
2answers
106 views

Command only working when put directly in command prompt, not in batch file

On my SBS 2011 I have a batch file called wakeup-nas.bat, with the following contents: wol.exe 5475e0d59ffa wol.exe is an executable for sending wake on lan packets. It is in the same directory as ...
0
votes
1answer
280 views

Port IE Bookmarks to Chrome [closed]

I want to be able to automate the transfer of existing Internet Explorer bookmarks to Google Chrome. We're rolling out Chrome to several users, but we want them to have their old bookmarks from IE ...
1
vote
2answers
67 views

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?
2
votes
1answer
109 views

Test Multiple Server for login (WIndows 2008)

I currently run a PING sanity check test (batch file with result file) on over 80 servers in 4 environment. But, even if we "ping" ok 100% of the servers, it doesn't mean that the machine are working ...
0
votes
1answer
593 views

Backing up database fully from remote server, and restoring to another remote server

I currently have three copies of my website (Live, Staging, and Development), with the database for each on three separate servers. More often not, a bug will appear that requires an up-to-date ...
0
votes
1answer
372 views

.bat file - Nagios v3.2 service check and start if stopped

I'm just barely getting into programming so I do apologize for my ignorance. I'm trying to create a .bat file that will check if a service is running on XP Pro. If service is running it will exit 0. ...