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
108 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
546 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
258 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
158 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
218 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
2k 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
188 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
4k 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
134 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 ...
7
votes
4answers
29k 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
884 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
186 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
813 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
80 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
491 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
394 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
444 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
390 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
215 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
113 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
530 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
250 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
2k 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
3k 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
596 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
264 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
436 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
4answers
516 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 ...
0
votes
4answers
213 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
438 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
3k 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
791 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
680 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
326 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
420 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
320 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 ...
1
vote
1answer
281 views

Why does appcmd.exe behave differently when executed inside a batch file?

I have the following appcmd to add an exception to IIS7's ISAPI and CGI restrictions. The exception I am adding should look like: c:\perl\bin\perl.exe "%s" %s Here is the command line: appcmd set ...
3
votes
1answer
1k views

Automated method to convert .reg registry file to reg.exe commands

Occasionally I need to put registry entries into batch files to use in login scripts, unattended installers, etc. While it's pretty easy to add one or two registry commands to a batch file using ...
8
votes
6answers
29k views

Batch file to uninstall all Sun Java versions?

I'm setting up a system to keep Java in our office up to date. Everyone has all different versions of Java, many of them old and insecure, and some dating back as far as 1.4. I have a System Center ...
1
vote
1answer
302 views

Preventing expansion of : in batch file for loop

Trying to build a cmdline tool for reviewing TFS changesets. Currently I have this: rem I know there's redundancy here, but don't care for now set /A curr=%1 set /A prev=%curr% set /A prev-=1 for ...
1
vote
1answer
113 views

Delete windows profiles with similar names using a batch file or script

I’m on a Windows 2008 server and would like to delete 15 users (user1 till user15) without having to do this by hand. After deleting them completely I’d like to readd them (again, with a script) and ...
0
votes
1answer
303 views

Script to copy file from server and install software

Here is what I want to do - I would like to install a software on every PC in my domain. I would like it fully automated. I am sure this can be done either using a batch file or a vbscript. Here is ...
0
votes
2answers
794 views

Batch Script With SQLCMD Usage

Hi All I am Writing a Batch Script Which has to read a set of SQL Files which exists in a Folder then Execute Them Using SQLCMD utiliy. When I am Trying to execute it does not create any output file. ...
0
votes
1answer
157 views

Windows Batch File

I am trying to execute a Set of SQL scripts using a batch bile. When I try this Windows batch file it doesn't run. Please tell me know how to write the script to loop through the files? My script: ...
1
vote
2answers
746 views

How to send the current working directory as an argument in windows?

I want to send a path as an argument to an executable. what I want to do something like this: pushd some\folder set x=cd popd MyExe.exe %x% the problem is that the x variable is now equal to the ...
0
votes
2answers
147 views

Batch syntax issue. Not quoting or escaping correctly?

There's some syntax that I'm missing here. Running this batch file: for /d %a in ("c:\Documents and Settings\*.*") do mkdir "%a\Application Data\vlc" for /d %a in ("c:\Documents and Settings\*.*") do ...