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
1answer
30 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 ...
-2
votes
0answers
18 views

Script to pull users login script from AD and run it from another location [on hold]

I am working on a project to solve the problem of users login script not working after domain change migration. Here's the situation: We used to have login scripts for all users and after the ...
0
votes
1answer
34 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
33 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
50 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
37 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
17 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
137 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
8 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
27 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
140 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
102 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
34 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
145 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
75 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
928 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
70 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
148 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
180 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
5k 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
372 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
187 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
175 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
1k 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
57 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
384 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
53 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
129 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
256 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
133 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
79 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
216 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
47 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
34 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
403 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
68 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
318 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
350 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
145 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
81 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
114 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
641 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
266 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
223 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
136 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
181 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 ...