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

BAT/CMD to launch a exe multiple times with different parameters without extra bat files

Have a bat that calls a single exe for say 5-10 functions. Is there a way to make the executable run in multiple processes from a bat or cmd? for example: start cmd /k cd Program ...
2
votes
3answers
378 views

I need to clear out the same directory on multiple servers across a network. How do I do this?

On multiple (about 20) servers, there exists the same directory C:\Deployments. This directory has multiple subfolders which contain more subfolders and files. The C:\Deployments directory itself ...
0
votes
3answers
680 views

Batch file and other scripts on windows 2008 r2

is thee a way to make a all the scripts in a specific folder running without the need of the UAC prompt? or maybe using power-shell to run the scripts without using "Set-ExecutionPolicy Unrestricted" ...
2
votes
2answers
2k views

find file newer than yesterday using batch script

I am trying to write a batch script that can find the files created/modified/newer since yesterday and/or any specific day from today in a particular folder. Then those files need to be copied to ...
0
votes
3answers
3k views

how to get default gateway of certain adapter in windows bat?

Please see below ipconfig output in windows. C:>ipconfig Windows IP Configuration Ethernet adapter Local Area Connection 11: Connection-specific DNS Suffix . : Link-local IPv6 Address . ...
-3
votes
2answers
217 views

How to sync windows server folders with a AIX server using script?

Everyday I would like to sync the files and folders in the windows server with AIX server and vice versa. Does anyone suggest me, How I can write a shell or bat script to achieve this?
0
votes
3answers
318 views

Windows Server 2008 R2 Scheduled Operations

Goodmorning everyone, I'm a newbie Windows 2008 s.a., and I'm stuck with a strange problem. I've made a very simple bat file that stops the Apache HTTP Server, copies a file and then restart the ...
0
votes
2answers
155 views

auto set permission on any file copied into folder

I have a batch file that copies folder from a temp directory to a public internet directory. The problem is, once the file is copied, the IUSR account doesn't have read privileges to the file and I ...
2
votes
1answer
328 views

batch file to dump data from database and dynamically name the file name

I have a batch process that dumps data from my database (windows 2008 r2) and I'd like to dynamically name my file with the day of the week included. is that possible to do with a simple .bat file? ...
4
votes
1answer
4k views

How to delete scheduled task from command line without confirmation? (schtasks delete)

I can create a task from command line like this: schtasks /create /tn SomeTask /tr "do.bat arg1 arg2" /sc ONCE /st 00:00:00 /sd 01/01/1991 and now I need to delete it. However the command needs to ...
2
votes
2answers
4k views

Passing CMD via PSEXEC to a remote computer via .BAT file

Using PSEXEC to call CMD for a DEL command on a remote computer through a batch script. PSEXEC \\hostname -u username -p password CMD /C DEL /Q /F C:\Folder\File.txt The script pauses with a new ...
2
votes
1answer
239 views

Enterprise Version Inventory for Adobe Reader 7,8,9,10

Is there a tool or method to build an inventory of the version of Adobe Reader installed on computers in a domain? This would allow specific targeting of Adobe Reader updates to the computers who ...
3
votes
2answers
6k views

Can I change Internet Explorer security settings using a script?

Is it possible to change Internet Explorer security settings using a .bat or .vbs file? Basically, I need to change IE7 and IE8 security settings for the local intranet. The settings I want to ...
1
vote
1answer
250 views

script (search & delete temp files/folder) has got a failure

I use this script to clean history, cookies and cache(Temporary Internet Files) for all users AND it should also clean the temp dir BUT there seems to be something wrong. 2 things get mixed up I ...
0
votes
2answers
3k views

Batch file for checking port status of multiple IP Address

How to check the port status of multiple IP Addresses from windows command prompt. I am looking for some Batch file or a Dos SCRIPT. Can anyone help on this?
2
votes
2answers
276 views

Windows batch file executes some commands that return output over and over

I tried to put commands that return output into batch file. When I run the batch file it executes the command over and over until I cancel with CTRL+C. I observed this behavior in Windows CE, Windows ...
0
votes
2answers
369 views

Using the move command with /Y in a bat file

I need to move all folders in a directory called Profile.V2 out of the directory and then I want to delete the directory. I'm using a bat file to do this which is below, this works perfectly except ...
10
votes
6answers
389 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
4answers
1k views

Batch file that spawns multiple Cmd prompt sessions running different applications

I am using a batch file to launch two different applications at the same time in different command line windows. Here is what I have: start cmd /k cd Windows\System32\ diskpart.exe >NUL & ...
0
votes
2answers
634 views

Robocopy website deployment script log file name truncated in AM

This is an IIS website deployment script I started to write. It moves files from directory A to directory B and creates a log file with the date/time as the file name. When it's run in the AM hours, ...
0
votes
1answer
618 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 ...
1
vote
1answer
220 views

How to find out what is wrong with a Scheduled Task when it doesn't error

I have a number of batch files, which all work when ran separably to back up various Postgres dbs across the network. However when ran through task scheduler the backup files aren't created. There are ...
0
votes
2answers
2k views

How to schedule batch file to run on the desktop in win 2008 R2

I have some backup batch file scripts which I was running in xp and I have migrated to windoes server 2008 R2 where it's not running in front when scheduled with task manager. I struggled a lot to ...
1
vote
1answer
737 views

command line REGEDIT command (edit) without a popup

I am attempting to disable UAC via a batch file with a REGEDIT command, and everything works - but, I need to be able to do this without clicking. When I run the: REGEDIT /S somefile.reg It works ...
1
vote
3answers
133 views

Running a batch file as an admin

Is it possible to run a batch script as an administer? We need this to be done without any user interaction, so there can't be any password prompt or UAC popups - is this possible?
1
vote
2answers
3k views

mysqlcheck doesn't support multiple contradicting commands

Any idea why I am seeing this error message? This script works fine on a ever so slightly older version of MySQL running on a different server with a similar config. :: check/analyze/repair/optimize ...
1
vote
0answers
577 views

Trying to install PEAR (running go-pear batch file) - getting “php_pdo.dll is missing” error

I need PEAR installed. So, I tried running the go-pear batch file inside by PHP extract. But it gives this error - The program can't start because php_pdo.dll is missing from your computer. Try ...
0
votes
1answer
783 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 ...
1
vote
1answer
2k views

Executing Windows administrative shell commands on Windows using Python

I have a batch script using Windows shell commands to perform several administrative actions. The script is running great on Windows 7 but when i try launching it from Python 2.6 nothing happens: ...
2
votes
3answers
8k views

Batch script to download many files via http?

I have a list of urls (over 100) of patch files from various sources that I need to download. I need to create a batch script that will download these files and dump them all into the same ...
0
votes
2answers
386 views

batch file to strip numbers from filename and pad to two digits

I have a text file with a list of server names (servers.txt) that looks something like this: server1 server2 server3 I have a feeling this can be done with the FOR command as I use that to perform ...
2
votes
3answers
2k views

keep command window open after running bat file

i have a bat file that has the following it: sm start "Schedule" this code runs but the command window closes immediately what can i put inside the bat file to keep the window open?
2
votes
4answers
241 views

possible efficient ways of transferring files from one server to another

what are the possible good and efficient ways of transferring files from one server to another? In this case it will be from windows server 2003 to windows server 2008 r2. I am thinking Powershell ...
2
votes
4answers
4k views

Remote installing programs by scripts or batch files

Firstly, I can't use Group Policy as our team doesn't manage that. The company is a massive FTSE company with a team for every aspect of IT you can think of. Our team needs a way of installing ...
0
votes
3answers
220 views

Batch file function

I need to create a batch file that will purge data from an existing file. Basically SQL server management studios does not overwrite backup data; therefore after the backups have been run and the data ...
1
vote
2answers
73 views

Batch file problems

I have created a batch file to copy and zip up an entire drive of data on my server. I have selected the D:\ drive to be copied and zipped. However, I have one problem. When I run the batch file, only ...
0
votes
1answer
179 views

Batch Script - Query Filenames From Server Printer

Client: Windows XP Print Server: Ubuntu via CUPS Is there a way to query the printer queue on the server from a client to retrieve the name of the file being printed? Code example would be ...
0
votes
1answer
131 views

Errors running Batch files

I have recently constructed a batch file on my server to zip up data and send it to a backup source for archiving. However when I run the batch file I get the following error... '7z.exe' is not ...
1
vote
0answers
304 views

How do i create a bat file to create user directory with proper rights and a script to reset it if something goes wrong

I need to create user and directories for the user and share it. The rights are set on NTFS structure only. The user must do all except change rights and take ownership this is not allowed and this ...
1
vote
3answers
783 views

Shortcut to open IIS 7 Manager so it Shows “Sites” view (status) by Default?

I would like to quickly be able to check whether a site is online after logging into the desktop of Windows Server 2008 R2 (x64). I would prefer to be able to do this in just 1 single or double-click ...
0
votes
2answers
276 views

Batch command to schedule multiple servers to shutdown

Our company is in the middle of a move between buildings. I've been asked to schedule the majority of our servers to shutdown at midday tomorrow. They already have a scheduled task for this, which ...
0
votes
1answer
521 views

Gracefully Terminate Console App Run Via Task Scheduler

I'm running a console application on Windows Server 2008. I want it to always run, so I have scheduled it to run at startup via the Task Scheduler. I set up the task so it does not require a login. ...
0
votes
2answers
1k views

Access a Network drive from another user from CMD (windows)

I have written PostgreSQL backups scripts that backup all the databases to file. pgAgent.exe (a scheduling daemon) starts the BAT scripts under the local postgres user. The normal setup is to backup ...
7
votes
7answers
13k views

“Delete Files Older Than” Batch Script

So in the work of doing backups, I need a batch script that would allow me to delete files in a specified directory, that are older than lets say, 3 days. This script will be set as a scheduled task ...
1
vote
1answer
536 views

Running an application as a different user (.bat / .vbs)

I need to restart an application using a service running on the SYSTEM account. The problem is that the application is then also started under the SYSTEM account. For various reasons beyond my control ...
0
votes
1answer
272 views

Disk Cleanup Batch File With Logs

I was wondering if there is a way to create a batch file that will run a Disk Cleanup (on XP and 7 PC's), and have it create a log file on the local PC that will tell me the details, or that it's run. ...
0
votes
1answer
106 views

It doesn't print the increased value of a variable in the for loop of batch file

As you can see I am new in the batch files, I have written a script in windows 2003 environment for print an increased value of the variable counter and also I have applied the if condition which is ...
1
vote
1answer
1k views

Change list of allowed logon computers from batch file

How can I change this setting from a batch file? For any given user, how can I make it so they can only log onto the computer named abc? A vbs or powershell script would be my second choice.
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
1answer
537 views

pscp (putty) copy only non-existing files/dirs

I'm using PSCP to copy directories from a linux machine to my windows machine. That works great, but I only want to copy those directories that are new and non existent on my windows machine. Is ...