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

2
votes
0answers
738 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 ...
1
vote
2answers
1k 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
3k 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
11k 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
435 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
3k 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
261 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
8k 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
226 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
76 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
187 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
133 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
341 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 ...
2
votes
3answers
911 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
285 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
649 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
2k 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
8answers
20k 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
681 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
426 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
115 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
2k 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
654 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 ...
0
votes
1answer
279 views

Two-way rsync between two servers

I read about rsync but I want to ask how can I do the following by rsync: I have two files in to different machine (UNIX-AIX) and have the same name. server1 : ..../file.txt server2 : ..../file.txt ...
1
vote
2answers
238 views

Why does the Windows command line change the command when running from a .bat file?

If I want to run the command md5deep -rb . | find /I ".jpg" | sort > local.md5 and I run it from the command prompt, it shows exactly like how I typed, but when I put it in a .bat file and run ...
1
vote
0answers
231 views

Jungle Disk - Pre and Post Backup Scripts

I've just purchased Jungle Disk so I can backup to my S3 account. One of the most important items on the main server backup is an Act database. In order to backup the ACT database using Backup exec ...
2
votes
2answers
3k views

How do I get the last part of directory from a command line

How do I store the last part of directory in a variable? For example I have the following path: A\B\C\D, I want to store D in variable like file_name=D.
1
vote
1answer
214 views

encrypt files by external GPG public key tools?

how i can encrypt files by eternal GPG public key ? for example user A generate public key A.pub and sent to me A.pub and you need from me to encrypt file by a.pub and sent it to you how i can do ...
1
vote
3answers
7k views

Store output of Windows command in batch file

I need to store the output of a command line in a variable. How can I do this?
0
votes
1answer
204 views

how i can read n first bit command output in windows batch file?

i use checksum command in my batch file and the output of command as follow : 69514a29dc44cd83b42658e917ed9baf *file.txt i want to return checksum only so i should store it in variable without ...
13
votes
4answers
53k views

How do you wait for an exe to complete in batch file?

I'm trying to create a script to execute an exe on shutdown in order to install sp1. my script goes something like (not actual bat script). If installed GOTO END Install.exe END: My problem is ...
0
votes
2answers
920 views

Bactch files: if-then-else and for loop syntax on Windows?

I want to write a batch file and we want to use if-then-else and for loop statements, but I don't know it and its option. Please can anyone help me?
0
votes
1answer
299 views

import configuration file when batch start ? (OS=Windows)

I write batch file and it has a large number of variable so i decided to put all variable on text file (conf.txt) and import it at the beginning of batch file so please i need the command line do this ...
0
votes
5answers
1k views

Send encrypted mail using GPG by command-line?

A few days ago I asked about how I can secure email and many people advised me to use PGP tool, and I read about it and I use it. Now I want to write a batch file to send encrypted email with ...
0
votes
1answer
95 views

Changing client devices settings for all users in AD group

I have over 40 users in an Active Directory that need client printers disabled so I can go back and allow only a select few users this without disabling through TSconfig. Really looking for a script ...
1
vote
1answer
629 views

How to check status of one port on remote host using NSClient++?

I know I could check for telnet on a known IP using other programs like: nmap -A 192.168.0.1/32 -p 23 Or, look for open ports from 20 to 30 on host.example.com: nc -z host.example.com 20-30 I ...
0
votes
1answer
432 views

How can a BAT script find the partition number of %systemdrive%

I am trying to write a BAT script to produce a grub4dos menu.lst file. A boot entry in the menu.lst file typically contains a line like: root (hdx,y) where x is the hard disk number(first disk ...
1
vote
1answer
448 views

more than one start statment in the same batch file?

I wrote the following batch file: start D:\folder1\bin\run.bat start D:\folder2\bin\run.bat start D:\folder3\bin\run.bat start D:\folder4\bin\run.bat It executes the first start but then gives me ...
2
votes
2answers
412 views

Batch Command Question

I want to make a batch file that designated as a folder name date of a previous day.How can I do? Here is my batch file. Set Tarih1=%date:.=% d:\ cd \ Yeni Klasör md %date:.=% cd %date:.=% ...
0
votes
1answer
243 views

Problem with relative paths(*.bat + VMWARE + Windows 2003)

I have posted this issue on StackOverflow but I thought this question might be a little more VMWare\Windows2008 server specific. Here's my question: I have two VMware instances of Windows 2003. I am ...
0
votes
1answer
1k views

Batch file code to find and rename all files ending in a space?

We host Macintosh files on our Windows 2008 servers. They have files like somegraphic.eps ._somegraphics.eps (hidden) Many times our users will add non-standard characters to the files, like ...
0
votes
1answer
116 views

Detecting whether on LAN from windows batch file

I'm setting up a couple of Windows laptops to mount home directories from our file server. The file server uses NFS for Linux clients and I've set up Samba for these Windows clients. At startup, I'd ...
1
vote
1answer
595 views

Create self extracting (.exe) zip from the command line

Trying to automate a manual procedure in place currently. This is on a Windows 2008 server. Is there a method to create a self extracting (.exe) zip file from a commandline/batch file?
1
vote
1answer
271 views

Batch access to NetBIOS locations / associated script

I'm trying to write a batch file to Access \sharelocation\folder\file Compare that file to c:\folder\file If the files are the same, run the local file. If the files are different, replace the local ...
1
vote
4answers
3k views

Why isn't my Scheduled Task running a batch script?

OS: Windows 2003 Server Setup: The batch file basically uses 7zip to zip up a few files into a location ready for uploading into an offsite location via FTP. I have run the batch file as myself and ...
1
vote
3answers
5k views

how i can get folder and file name in windows and store it in variable?

i have a folder folder1 contain 3 files file1 , file2 and file3 ... i need command line to do the following task ... store the name of file in variable ... because i want to write dynamic batch
0
votes
2answers
668 views

Batch-script implementing 2 ODBC-connections

Thanks for all previous help! I have a question regarding av script. My computers is all XP, and needs the following when I do my thing : I have 2 ODBC-connections (towards MS-SQL-DB), which I have ...
0
votes
2answers
277 views

What is wrong with this batch-script?

I've beeen trying to set up a batch-script which should do the following: First, install a exe file, preferrably quietly (of course check if it's already installed). Then traverse to where .net ...
0
votes
1answer
440 views

Script to check directory existence and install software

Firstly, please excuse my ignorance as I am completely new to scripting.. Here is what I am planning to do Stop the service (it would be good if i could check if service exists in the first ...