0
votes
0answers
12 views

Add contact to SBS 2003 active directory remotely

Masters, We need to often add or remove contacts in active directory. It is possible to delegate access to a user (with or without administrative rights) to do this remotely (without log in via ...
0
votes
0answers
39 views

After setting file association with FType, images still launching in other program

I'm aware of how to use Assoc and FType to set the default program that a known file extension will launch in. I need to create a simple batch script to re-associate all of the image file extensions ...
-1
votes
1answer
84 views

portqry to check connectivity

Is it possible to check the connectivity between 2 remote servers using portqry given that the portqry.exe command is executed on another server. for example, check the connectivity between serverA ...
1
vote
2answers
76 views

computer startup script reporting success to a server

I am using Group Policy to deploy a computer startup script that tries to uninstall one program and install another. I need this script to report its status (whether a certain file exists on the ...
1
vote
1answer
136 views

Batch script to create home home directories from list of names

I'm trying to create a home directories with permissions from a text file. I can only get the batch file to run the first line. Can anyone tell me why? I initiate the scripts by running go.bat as ...
0
votes
1answer
179 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
0answers
63 views

Batch script terminates too soon

I need some help with Windows batch/CMD scripting. I wrote a script to record mic-in to a MP3 for 12 hours. It runs ok when running it manually. It will run with task scheduler too - just that, ...
0
votes
1answer
215 views

How to reference Domain-Admins with icacls?

I need to reference the "Domain-Admins" group in a batch file. The line in question looks like this: icacls "test\folder" /grant mydomain.com\Domain-Admins:F ... and works as expected. But how do ...
0
votes
1answer
522 views

How do I delete a remote file using NCFTP (Windows client)?

With ncftpput.exe how do I delete a remote file once logged in? I have tried using the -W option to send a Raw FTP command but cannot get it to work. Has anyone got a working example? Have tried ...
1
vote
0answers
80 views

Windows file compare (FC) spurious differences

I'm getting differences like this: a.txt Betty Davis Cathy Edwards b.txt Betty Davis Cathy Edwards There are only two lines listed in the diff (which doesn't ...
2
votes
1answer
417 views

Checking .BATs exit code with NAGIOS?

I currently have the following script on a Windows Server: @echo off set path=%PATH%;C:\UnxUtils\usr\local\wbin cd /D Z:\videos forfiles /M *_1.mkv /D +%date% > C:\mkv.txt >NUL 2>&1 ...
4
votes
1answer
3k views

Batch script to test if a folder exists fails when checking a UNC path

I've written a small batch file to help us with a server migration to remap user directories using GPO. However in the batch file I'm having a syntax problem that appears right but it's still ...
0
votes
1answer
74 views

Creating Directories with a Batch file [closed]

I am intested in creating a batch file that can read in a text file which has four variables: customer name, customer number, customer order, products orders. I am using: FOR /F "delims=, ...
1
vote
1answer
291 views

Change Registry Value Command Line

Is there a way to set a registry value with a command line without using a .reg file to import it? I've looked over the reg and regedit.exe command line options, and it doesn't look like there's a ...
2
votes
1answer
79 views

I'm having trouble finding these commands to run in a batch file?

I want a batch file to pull information from the first line of a text file (notepad), use that information to add information to a DNS server, and then delete it. I'm thinking if I create a loop, I ...
0
votes
1answer
212 views

Problems encoding an HTA file to run Java+Batch files for DNS server

I'm having a problem coding a .HTA file, and I really need some help. I've been searching all over the place and I can't seem to find what I need to add to this code to make it run. I'm trying to get ...
1
vote
1answer
99 views

Why can't I get the `for` command work in my command line [closed]

This could also be read "Why can't I get the for command work in my batch file." When I try using the command: FOR /F "tokens=1-4 delims=/ " %%a in ('something cool') DO something else cool %%a %%b ...
0
votes
2answers
642 views

Remote GPO through BATCH Script exiting

Right so, I'm trying to make a remote GPO script that from one of our management machines will push the GPUPDATE command to certain servers. After some googling I found a script that I tried to ...
0
votes
3answers
3k views

Deleting the oldest file in a folder with batch scripting

I have to write a batch file to delete the oldest file in a folder, but i don't know how to get the name of the oldest file. I can sort files with DIR, DIR /B /O:D /T:C but this is a list and i need ...
2
votes
1answer
768 views

Dos Batch File Help: Storing %%c variable from FOR loop [Resolved]

It's been a while since i've had to write a batch file, and i'm having trouble with the following: @echo off SETLOCAL ENABLEDELAYEDEXPANSION for /f %%a in ('dir f:\*mssql* /ad/b') do ( for /f %%b ...
1
vote
2answers
566 views

Run batch script showing output & recording output to a file

I know cmd > file.txt to record an output of a command to a file in Windows!. Does anybody know how to run a batch script recording the output to a file AND also showing the output on the command ...
1
vote
3answers
131 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?
-2
votes
1answer
204 views

shell script doesn't run correctly in cron [closed]

I want to call a shell script I wrote from a cron. The shell script uses the program Linkchecker. If I run the shell script from the terminal it works just fine. However, when cron runs I get the ...
1
vote
2answers
549 views

How to automate FTPS uploads from the Windows Command Line

I'm looking for a batch script to automate the upload of MULTIPLE files at a time to an external ftps site (ftps://servername.xxxx.com).The files are located in a folder on a Windows Server 2008 ...
2
votes
1answer
4k views

Split string line read by a batch file

is there a way to "split" the value of string line readed by a batch file ? Suppose to have this text file 192.168.1.2; PC_NAME_1 192.168.1.3; PC_NAME_3 ... I would like to read line 1, and split ...
0
votes
1answer
196 views

Install cmd script to set user environment variables from file

Each line in input file.txt has two values separated by a space. Currently using: for /F "tokens=1,2" %%i in (file.txt) do call :setvars %%i %%j :setvars set %1=%2 set %3=%4 set ...
6
votes
7answers
14k views

Need leading zero for batch script using %time% variable

I came across a bug in my DOS script that uses date and time data for file naming. The problem was I ended up with a gap because the time variable didn't automatically provide leading zero for hour ...
1
vote
2answers
545 views

batch script to retrieve zero byte files

How to retrieve zero byte files and copy into a folder using batch script. can someone help me out. i want the script should check the subfolders and displays the output as complete folder path in ...
1
vote
1answer
87 views

Is there a way to create a custom installer package to do batch installs of a bunch of programs at once?

Basically I want to create a file which will automatically install a bunch of files without having to manually install each of them (i.e. Flash, Adobe Reader, MS Office, etc.). I'm guessing the ...
1
vote
2answers
380 views

Bat file in another account

I have a bat file which will delete files in some folder (Profile Folder). But i do-not have access to that folder. But another account has access to the folder. How to run a batch file from one ...
0
votes
2answers
2k views

Checking file properties in a batch script?

I have a batch file from a vendor to patch some software on a Vista machine. I'm going to be using GPO to push it out as a startup script. My problem is some systems require this software and some ...
4
votes
2answers
5k views

delete registry key using wildcards

I'm hoping to find a way to delete registry keys based on wildcards using a batch file rather than writing some vbscript. Does anyone have an example? I'm forced to proceed with MS's wonderful ...
2
votes
2answers
1k views

Setting Variables in Windows Batch Scripts

I need to set some variables based on an argument for a windows batch script. @echo off if [%1]==[] ( echo "Usage: xxx <AAA|ZZZ>" ) else ( if [%1]==[AAA] ( SET ...
1
vote
1answer
684 views

Running a windows batch script in a separate process

I want to start a long running process from a windows batch file. The start script should just call the second script and return, end. How can I achieve this? Thanks!
2
votes
2answers
4k views

Adding numbers stored in variables in windows batch script

I have a loop in a batch script and I would like to do some arithmetics with the loop counter. I found out how to evaluate expressions, how to add numbers here: ...
3
votes
2answers
2k views

Evaluating expressions in windows batch script

This one could turn out as the dumbest question ever, as I am probably missing out the obvious. Anyway, here it is: Can you evaluate expressions in a batch script. For example, I want to add two ...
1
vote
6answers
2k views

Copying Directory Tree on Windows

I need to copy a full directory tree (aka recursive copy) with a bat files on windows. On *nix systems I use the -R argument on the copy command, like so: cp -R fromDir toDir and that did the job. ...
0
votes
2answers
2k views

Create a batch file that deletes all user data folders except for All Users and Default User?

I am using Windows XP and would like to create a batch file that deletes all user data folders except for All Users and Default User. How can I achieve this?
0
votes
2answers
450 views

Post-startup & Pre-Login shutdown

Is there a way [using a batch file] that I can set a system to shutdown PRE-login but POST-startup? I've tried a scheduled task to run this batch file with the "/SC ONSTART" flag .. That didn't work. ...
0
votes
3answers
2k views

Need to exclude a specific result from a Batch For Loop

I have a script that recursively loads files from a specific directory (and subdirectories) into a java classpath using a FOR loop. It looks like this: FOR /r directory %%F IN (*.jar) DO call :addcp ...
0
votes
4answers
16k views

Command Line Winrar & Batch Scripts

I've written a wee batch script to backup some stuff on my desktop and dump it over the network to a share... The only thing that's bugging me is the verbosity of rar.exe while it's doing the ...