2
votes
2answers
179 views

Batch rename directories with regex via command line on Linux

I have a folder on the server that contains directories that are created daily and are named by date, like so: 07-06-14 08-06-14 09-06-14 etc. At some point I decided that a preferred naming would ...
0
votes
0answers
85 views

Output results of findstr at a Batch file so they can be read by PHP

I have this Batch file which looks for a string through a the files in the current folder: @echo off for /f %%i in ("*") do ( findstr /m /C:color "%%i" ) Now I would like to output the ...
1
vote
1answer
160 views

How to dump certificate file from installer via command-line?

I'm building a script that will download and install a bunch of programs. One of those programs depends on a virtual driver, which needs its certificate to be imported in order to function. Normally, ...
0
votes
4answers
602 views

Windows XP batch file to block all incoming and outgoing traffic

Is it possible to block all incoming and outgoing traffic on a Windows XP host via batch file? Bonus question, I only want to allow 1 outgoing port and all traffic going over that port.
1
vote
1answer
101 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 ...
1
vote
1answer
731 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 ...
0
votes
2answers
2k views

How can I find multiple values from windows command line output?

Example, to see if KB983590 is installed: systeminfo | find "KB983590" But what if I wanted to find out if more then one KB was installed?
17
votes
4answers
57k views

Get directory containing the currently executed batch script

I use %0 in batch file to get the containing directory of the batch file but the result is :- c:\folder1\folder2\batch.bat I want just directory, without batch file name, like this :- ...
0
votes
1answer
147 views

How to create a windows user from the command line, using a password from a file

Im in a somewhat unique situation. I am trying to create a windows user, using the command line or a batch file. I know how to do that in the basic case: net user username password /add The ...
1
vote
1answer
440 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 ...
4
votes
5answers
1k views

shortcut for Eventvwr > Connect to another computer

I was wondering if you can write the following action in a batch command? eventvwr (open the event viewer) Menu Action > Connect to another computer Type in the name of the computer. Connect. This ...
2
votes
5answers
6k views

How do I redirect/save the console to a file and keep it visible on the screen?

I want to save a program's output (stdout) to a file but still be able to see the output on the screen in realtime. I need a solutions for both Linux and Windows.
2
votes
2answers
1k views

Batch file to call multiple batch files and keep going after errors

I have a batch file like this, the issue that I have is that if the first batch file fails, the second one never gets started, how can I get them to both keep going? @echo off MapNetworkDrive_J.cmd ...
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 ...
3
votes
1answer
16k views

cmd.exe: how to start a background process, run some things, stop background process

I want to run a batch script that: starts a background process (a Selenium RC server, if that matters); waits until the background process starts to listening some port (or wait a fixed amount of ...
0
votes
4answers
17k 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 ...
0
votes
2answers
5k views

Edit local user account remotely: set passwordreq:yes

I'm using Net user username /passwordreq:yes but I need to do this on a bunch of machines. I can run a batch through SCCM, but would like to do it with a script. Anyone have a way to do this? ...