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

BAT file to extract folder name from a file name & move the file into that folder [migrated]

I'm not very familiar with windows bat file programming and I would appreciate any help with this. I need a bat file to do the following: extract folder name from a filename - eg, extract Chemistry ...
5
votes
2answers
175 views

How to query the task manager

I know the tasklist command in Windows will give a list of task names and their PID. There is another command WMIC path win32_process get Commandline which does give more detailed information, but its ...
1
vote
1answer
59 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 ...
2
votes
3answers
43 views

How to see what last batch was run on windows

Is there a way to see what was the last batch (something.bat) run on windows? I was in a folder which contains lots of batches, as I was opening them one by one by right clicking and selecting ...
0
votes
1answer
46 views

How to remove string and replace with content found in text file using batch script or powershell

How to remove string and replace with content found in text file using batch script. test.txt Version: 4.5.0 Import: //MPackages/Project/config/abc.txt #head ...
0
votes
1answer
58 views

The system cannot find the file specified- Task Scheduler. Win Server 2012

I have batch script file, which should encrypt a file with pgp. I have defined a task in task scheduler to do this, but I am keep receiving the error"The system cannot find the file specified". ...
0
votes
1answer
35 views

xcopy on Batch file for backup server

i have 5 servers connected and want to backup a folder on servers 1,2,3,4 to server 5 and folder on server 5 to server 1. i write a batch file that use xcopy to copy the folders. my question is if ...
-1
votes
1answer
124 views

Execute bat file via php on a local network to run on any PC connected

I have a web app which runs on a local server (XAMPP)...its on a computer (PC1) which serve as a server..other computers are connected to the same wireless network and can run the web app also from ...
0
votes
1answer
50 views

Find 0kb files on a hard drive and replacing them with same name file from a different hard drive

Recently installed a new Windows 2012 Essentials server for a client. They had a very old XP system they had been using as a file server. Several weeks after what appeared to be a successful ...
-1
votes
1answer
34 views

Search for file names containing space

I have a batch file that helps me in install multiple pieces of software from a shared folder. It's working well with software whose names don't contain spaces, but I need it to work with software ...
0
votes
1answer
61 views

Batch script to increment the text file ans also the value inside the file [closed]

I have a text file Foo.txt which contains value content0. I have to create a batch file which increment the text file like Foo1.txt, Foo2.txt.....Foo5.txt and also the values in the file content1, ...
0
votes
2answers
56 views

Bat script start a program and than restart

I need some help creating a .bat script that starts a program and when done it restarts the computer. cmd /c C:\"Program Files"\"Toolwiz Time Freeze"\ToolwizTimeFreeze.exe /usepass=password ...
0
votes
0answers
22 views

“Password Expired” when attempting to access Win7 machines on local network with our local admin account

Looks like all of our Win 7 and Win 8 machines were somehow set to expire the admin account that we created locally a couple months back. Now we're trying to make sure we either have to go to ...
2
votes
1answer
176 views

Running Batch file with elevated rights through GPO

I have a shortcut that specifically uses Google Chrome. We have XP and Windows 7 in our environment, and I want to only use one shortcut for both OS. The reason being is that our environment is quite ...
0
votes
0answers
10 views

Error Reporting for File Copy Process

I have a rather complex process in place which runs a java program to retrieve service records from our CRM and export them into an excel spreadsheet, which gets placed onto a server in our data ...
0
votes
1answer
31 views

Modified batch file that kills a certain process

I am looking for a simple batch script that kills a process which listens to a certain ip and to a certain port. If there are less than 10 connections to this process, then it should be killed. If ...
0
votes
1answer
173 views

Icacls works from command line, not from batch file

The OS is Windows server 2012. I am trying to use command icacls C:\folder\targetfile /grant domain\usergroup:(rx) to give permissions on certain file. The command works when executed on command ...
1
vote
1answer
131 views

Batch file that kills a certain process

I am using the following script to kill a process in CLOSE_WAIT state that listens to a certain ip and to a certain port. FOR /F "tokens=5 delims= " %%I IN ( 'netstat -ano ^| find ...
0
votes
1answer
37 views

Cannot use PStool for more than 7 PCs over LAN

Below is the batch file command I am currently using to shut down remote computers on our LAN. Here is what it does. I have specified the remote computers IP address in text file named list.txt I ...
1
vote
1answer
208 views

IIS backup on Multiple servers from Powershell

Can someone help me with backup of IIS on multiple servers from powershell script remotely. I can take backup of IIS from powershell command. backup-webconfiguration -name IIS_backup. Also i have a ...
1
vote
0answers
91 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 ...
5
votes
1answer
2k 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
85 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
166 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
188 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
6k 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
462 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
216 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
196 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
2k 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
59 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
427 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
56 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
145 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
303 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
158 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
81 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
235 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
49 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
35 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
1k 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
2k 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
450 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
73 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
336 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
3k 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
381 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
162 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
88 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
119 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 ...