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

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
330 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
869 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
283 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
608 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
7answers
17k 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
606 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
352 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
112 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
615 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
270 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
216 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
224 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
203 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
6k 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
178 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 ...
12
votes
4answers
42k 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
905 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
231 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
964 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
87 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
557 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
415 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
446 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
408 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
235 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
115 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
569 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
262 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
4k 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
626 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
270 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
439 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 ...
0
votes
3answers
526 views

how i can make batch file in windows read the output of somthing from unix bash file?

i want to make incremntal backup for repository by the following command :- svnadmin dump myrepos --revision 1001:2000 --incremental > dumpfile2 but i want to copy the output on windows box as ...
1
vote
4answers
229 views

Preventing a program from opening

I am supporting a few offices across the country running Windows XP. They are stand alone, no Windows Server or Active Directory, anything like that. I just switched them over to Google Apps, and in ...
1
vote
3answers
1k views

.bat files to find all files on drive bigger than X

So far I run a .bat file to find all the media files stored on our student shared drive, which then writes to a .txt file in my documents, for example: dir S:*.mp3 /s > "M:\logs\student\mp3.txt" ...
0
votes
1answer
448 views

Making sure a batch is run with admin privileges

We use batch files to do simple installations of COM servers - mainly a few file copies and regsvr32s. Since regsvr32 writes to the registry's local machine hive, the batch must be run with ...
1
vote
2answers
4k views

don't show batch file command when execute it?

when i execute batch file on cmd screen the command in the batch appear on the screen example :- batch file :- @echo off. command1 command2 when i execute it on cmd the following appear on screen :- ...
3
votes
1answer
891 views

how i can pass a file directory (path) as parameter?

how i can pass a file directory (path) as parameter to batch file in windows operating system bash file in unix operating system
2
votes
1answer
700 views

VirtualBox on Windows Hosts | Export and Import batch automate

VirtualBox on Windows I am planning to deploy virtual box on around 10 computers (Vista / 7), I have setup a centos vm and exported it as an appliance with the ovf and vmdk files in the same folder. ...
0
votes
1answer
334 views

Batch Files..How Iterate over drives using wildcards

I would like to clear the contents of some text files that are in several sub-directories across 2 hard drives on my computer. I would like to do this by a batch file for my ease of use / ...
1
vote
1answer
433 views

Batch File to delete contents of folder not modified in the last 3 days?

Anyone know of a script which I can execute with task scheduler which will allow me to delete the contents of a specified folder, but only the content that hasn't been modified for the last 3 days?
0
votes
1answer
327 views

Last Logged on User on Offline Windows Installation

Recently at work, I was wondering if there was a quick batch command I could use to look at some output and quickly determine which was the last user who logged on. Users do not have roaming ...