Questions tagged [batch-file]
batch files are simple text files executed in a command to achieve a particular task or a set of tasks
441
questions
-1
votes
1
answer
1k
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
1
answer
215
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
vote
1
answer
2k
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
1
answer
125
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 ...
1
vote
0
answers
88
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
1
answer
90
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 ...
1
vote
1
answer
4k
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
2
answers
9k
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
0
answers
2k
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
1
answer
166
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
1
answer
2k
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
2
answers
15k
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
1
answer
2k
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
2
answers
474
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
1
answer
167
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
2
answers
365
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
2
answers
3k
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
1
answer
823
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
1
answer
792
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
1
answer
51
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
1
answer
382
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 ComputerList=C:\Users\...
3
votes
1
answer
3k
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 ...
5
votes
1
answer
1k
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
4
answers
2k
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
1
answer
2k
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 "\\myserver\...
0
votes
0
answers
295
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 \\server\Taskpad\...
1
vote
1
answer
2k
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 ...
3
votes
5
answers
9k
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
z:\Apps\...
0
votes
1
answer
757
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
2
answers
200
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
1
answer
3k
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
2
answers
1k
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
1
answer
845
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
1
answer
2k
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
1
answer
2k
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.
...
0
votes
2
answers
2k
views
Batch File to Loop Through Folders and Process If Specific File Found
I have a large number of websites running the same CMS that I want to update as a batch. As the update process just requires copying the updated files into the folder of the given sites, a batch ...
-2
votes
1
answer
2k
views
Script to copy down portions of a roaming profile [closed]
I'm currently working on migrating users to Windows 7 from XP. We use roaming profiles. Xp creates a folder named "Profile", while Windows creates "Profile.V2". Theses folders are independent of each ...
0
votes
1
answer
5k
views
How to escalate to administrative token in Windows 7 using only CMD.exe [duplicate]
If I am not able to right click on CMD and run as administrator, or CTRL + Shift + Enter to run CMD, but I am using an administrative user account in a non-admin shell (CMD.exe); How in the world do I ...
2
votes
2
answers
15k
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.
0
votes
1
answer
2k
views
Running scheduled task in current profile with another user
I have a doubt about Windows scheduler: I created a domain user (backupuser) appositely to launch a batch file that starts the backup. The problem is that the batch is launched in the "backupuser" ...
1
vote
0
answers
909
views
Display only the last line of a windows command line executable
I'm trying to write a batch script that manages simple software deployments. One of the steps in the script compresses a file structure into a 7zip archive.
During the compression process, the z7ip ...
0
votes
1
answer
2k
views
Record more events with procmon [closed]
'Process Monitor' has a max history depth of 199 million events. I need to record about 10 times this. I don't mind if the data is split, e.g. a new data set for every hour. Anyone know how to do it? ...
3
votes
3
answers
22k
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
1
answer
84
views
Enable Recovery console from a batch
I want to enable the Recovery Console on a lot of Windows 2003 servers.
I want to automate this so I don't have to manually do it on hundreds of servers.
The recovery console install process seems to ...
0
votes
1
answer
82
views
Netsh batch file
Is there way to join win7 to server 2008 by using netsh batch file ?
I can change The IP , GateWay , Subnet Mask by bat file but How can I join domain
15
votes
1
answer
6k
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 ...
0
votes
1
answer
1k
views
Windows batch find folder if statement
Assume a file system with the following format
Folder A
--->Folder 1
--->Folder 2
--->Folder 3 etc..
Folder B
--->Folder 4
--->Folder 2
--->Folder 3
Folder C
--->Folder 1
--->Folder 2
--->Folder 3
---...
2
votes
1
answer
7k
views
Batch - how to copy file by minimum size and date modification?
I have this simple batch script which copies the newest file in some dir to another place.
I want this script to also ignore all files (in the DIR command section) under 1GB of size.
FOR /F "delims=|"...
0
votes
1
answer
1k
views
Elevate batch file via UAC
I have found the following routine which is supposed to allow a batch file to issue a UAC prompt and elevate itself to admin. Problem is on Server 2012 it doesn't seem to work for me. According to ...
0
votes
1
answer
516
views
Clearing temp files - Batch file pattern matching for *.tmp also includes *.tmpll
A file match for *.tmp also returns various *.tmpll files, is there anyway to restrict it to *.tmp files only?
dir C:\*.tmp /s
Also lists a load of *.tmpll files as well.
Reason for doing this is ...