0
votes
0answers
30 views

Windows cmd output redirection to standard input ( >&0 )

From a question on Stackoverflow, i've being testing with redirection from/to stdin stream. And this tests, trying to send data to the stdin stream, just to see what happens, end with an apparently ...
0
votes
1answer
23 views

Batch file to read a file and create a JSON?

I have a text file with some dozens of entries in the following format: code: SETX id: 1 msg: Message for setx code: SETY id: 2 msg: Message for sety msg_ja: Japanese message for sety As you can ...
0
votes
1answer
35 views

.bat file to rename files (not bulk)

I take pictures of airplanes. When i put them on the computer they are named DCS_5678 (or anotrher number :p ) The way i catalogue my pictures is by renaming them as followed: ...
1
vote
0answers
35 views

.bat script doesn't work by using window scheduler

i created a .bat script to perform daily folder compression. it is working fine when i double click the .bat file. However, it doesnt work when i include it in window scheduler. Below is the script: ...
0
votes
0answers
16 views

Prefix commands in batch

I am using a batch file to run Grunt with some console customization. I was wondering if there is a way to add grunt and a space to the commands I enter into the console. Here is my batch file: CD ...
0
votes
1answer
56 views

How to start a cmd window and issue tail request in a bat file?

I can open a cmd window and start a tail by entering something like this: tail -f C:\Oracle\WebCenter\Sites\11gR1\Sites\11.1.1.6.1\logs\sites.log This is probably a stupid question, but how do I do ...
1
vote
0answers
49 views

APC Smart-UPS 1000VA - command file won't get executed

I've got this old piece - http://goo.gl/5M37Sc, working reliably so far, but it has one big problem: command file when power is down won't run. Everything seems to be configured correctly, but when ...
-1
votes
1answer
24 views

Export windows Environment variables to a file. [duplicate]

Can we write a batch file to export all or some environment variables to a file in windos 7?
0
votes
0answers
22 views

How can I start a batch script before open some type of file?

I'm writing some custom lock file system for my company. I want to start my lock_engine.bat before open some type of file. for example here my bat: @ECHO OFF set FILENAME=%~nx1 echo. is locking ...
0
votes
1answer
68 views

Batch rename all files in folder to uppercase

Is there a way to rename all files in a specific folder to uppercase? I found this code but it renames files to lowercase, can it be modified to change to uppercase instead? for /f "Tokens=*" %f in ...
0
votes
0answers
27 views

Replace “open command window here” to open git sh.exe bash

Is there a way to replace the default option in windows context menu to open command window in the current directory to open git's sh.exe bash in the current directory?
-2
votes
0answers
29 views

Check if each file in a list exists

I have a .txt with a list of name files: 111.pdf 222.pdf 333.pdf ... I need a script that checks if each of these files exist in a given folder, e.g. c:\files\. Is this possible?
0
votes
1answer
74 views

Windows Batch File (WMI) - taskkill process based on memory usage

Is there a way using WMIC, bat files, or powershell, to kill a task with a particular task name if the amount of virtual memory the process is using is above a certain limit? Specifically I want to ...
1
vote
2answers
132 views

bat file behaves differently when run from windows scheduler

I have a .bat file S:\BACKUP_db\copytofileserver.bat, which takes some files and zip them to the network drive. Its first command is to delete the old backup at specific network path, then pack the ...
0
votes
1answer
39 views

Batch file in windows scheduler

set PATH=C:\Users\... call date2.cmd md %DT_MM%-%DT_DD%-%DT_YYYY% cd %DT_MM%-%DT_DD%-%DT_YYYY% So, I set my path to the folder that has PSFTP for me to run and run a file that will get the current ...
-1
votes
0answers
35 views

Windows script to copy files from C:\ to Backup B:\ but leave a SYMLINK copy back on C:\

I have a particular way to "backup" my stuff, in that I copy everything large (movies) etc from my main drive C:\ to an external backup drive B:\. Then make a SYMLINK of the file on B:\ back to C:\, ...
0
votes
1answer
30 views

Run a block conditionally on grep output

I've found a number of solutions to this problem, but unfortunately none of them seem to work on my windows box. I'm running a FOR loop in a batch file to loop through a number of text files. For ...
0
votes
1answer
77 views

Windows batch file - How to pipe output to text file and then open the text file?

I have a weird problem where I have a simple batch file that runs another batch file, outputs what is on the screen to a log file, and then attempts to open the log file. The problem is, the log file ...
1
vote
1answer
39 views

How can I write a windows batch file that opens a command prompt and executes a command?

I want to create a .cmd file that opens the command line at a location relative to the .cmd file itself, and then executes something like this: someapp start ../../config.js How can I do this?
0
votes
1answer
35 views

Writing time in a file in a for loop

In windows 2008: I'm trying to zip and copy files to a backup server. I use command line/batch file, I log the result in a log file, I now want to log also the time for each file looped. The ...
0
votes
1answer
55 views

Batch Issue - Creating folders and Moving Documents

I’m trying to create a batch script in Windows 7 that will look at the first 6 numbers of 100s of pdf, create a folder based on the 6 unique numbers and move the pdfs into their respected folders. ...
0
votes
1answer
37 views

Batch file XCOPY cannot find existing directory

I'm writing a small batch file to copy my C# project to another drive. I'm using XCOPY to copy an entire folder (We have some XP machines still, so robocopy isn't an option). However, when I run the ...
0
votes
1answer
119 views

How to send mail from a Windows batch file

I want to send a mail from a Windows batch file. Here is my code: blat test.log -server smtp.gmx.com -to dest@gmail.com -f address@gmail.com -s "test mail" -u "address@gmail.com" -pw "password" ...
0
votes
0answers
69 views

Windows batch script: Manual power up vs Wake on Lan (WOL)

OK, I have a (win 7) desktop computer with WOL set up so I can turn it on remotely, it works fine. Next thing, on this computer I have a batch script, which runs at startup and starts various apps, ...
-2
votes
1answer
37 views

Loop Counter not working

@echo off setlocal enableextensions enabledelayedexpansion set /a eng_aud_count=0 set /a eng_sub_count=0 For /f "tokens=1-9 usebackq delims=.:^)^( skip=2" %%A in ("MY text File") do ( set trck=%%B ...
1
vote
0answers
51 views

CMD install based on OS type and architecture [closed]

I am looking for a way to do a CMD install based on OS type (XP, Vista, 7, 8) and architecture (x86 or x64). So for an example if the script detects the OS is Windows 7 x86 (regardless of ...
0
votes
2answers
90 views

Batch file rename with random alphanumeric

I am looking to rename a bunch of images (all with .jpg extention) with random alphanumeric names. Example would be 08kDRH1s.jpg or 0FwzUc3.jpg. Doing some searching I did find a few batch scripts ...
0
votes
1answer
59 views

Using a .bat file to pull a string from a text file within a zip folder

So, please bear with me. This is only the second batch file I've ever written and my first post anywhere on StackExchange. I'm writing a batch file that tells a remote server to run HP Array ...
-1
votes
1answer
59 views

What comand do I enter into my batch file to do this?

I want my batch file to find a string in a file and return it to the next line in my batch file. How can I do this? I've googled over and over but can't get the specific answer I need with the ...
0
votes
2answers
104 views

How do I concatenate files using a list and batch?

I need the equivalent of the shell command xargs < list.txt cat -- > compiled.txt as a Windows batch file. There is a directory full of text files (about 50 to 500 files) that I need to ...
0
votes
1answer
555 views

How to automatically enter username and password for network location in batch file?

I have a batch file that copies files to a network location on WebDAV. The address looks something like this: \\xxxxxxxxx.net@SSL@2078\DavWWWRoot When I restart my computer, the batch file doesn't ...
1
vote
0answers
40 views

Windows / Create txt files of subfolders with file names in it

I have a folder on my HDD that contains like 1000 or so subfolders. These subfolders contain files and sometimes more subfolders. Now what I want to have is a script that creates a .txt file for each ...
0
votes
1answer
126 views

xcopy command does not work in a batch file

The command below works in CMD Prompt, but does not work in a batch file. xcopy "D:\Desenvolvimento\Repositórios GIT\driverXD\app\*" driverxd\ /e
1
vote
1answer
80 views

Is there a script "to log remote users off and after log them off to delete their profiles?

I found 6 simple scripts (.bat and .vbs) for remote pcs (Win XP and 7) to Clean Profile properly and faultlessly: Script: sending Ping to check Remote PC On or Off (.bat) Script: checking who logged ...
1
vote
1answer
85 views

CMD Command to create folder for each file and move file into folder

I need a command that can be run from the command line to create a folder for each file (based on the file-name) in a directory and then move the file into the newly created folders. Example : ...
0
votes
1answer
150 views

Script to enable/disable IPv4 on a specific network adapter Win 7

For reasons I don't wish to get in to at the moment I need to occasionally disable Internet Protocol Version 4 (IPv4) on my wireless card, then enable it some time later. Currently I go into the ...
0
votes
1answer
83 views

Need help creating a .bat file to execute SAS jobs

Using Windows 7, I need a .bat file that will execute files in a folder whenever I put them in there. for example I want it to execute files with a .sas suffix and then rename them once executed. I ...
0
votes
2answers
152 views

Move 1 file at a time based off timestamp using windows batch utility

I am trying to build a .bat file to move files from 1 folder into another one, based off of the oldest time-stamped file. Folder 1: Filename: Date Modified: test1.dat 5/12/2014 4:03pm ...
0
votes
0answers
40 views

Windows filename formatter BAT script?

At work we upload files for publishing to the web. The filenames people use are atrocious. Is there something easy out there like a .BAT file that they can drag the file on to to have it clean up the ...
0
votes
1answer
45 views

how to use Null is Batch script

I working on small program to update the configuration of small program, I'm new to batch script, user need to enter desired input to go to desired program and I have 5 set of programs with in the ...
0
votes
2answers
190 views

Can not schedule a batch file to run at startup [duplicate]

I'm trying to schedule a batch file to run at start up. Here is my command: schtasks /create /tn test /tr c:\simple.bat /sc onstart simple.bat only writes the current time to a file: time /t > ...
0
votes
0answers
93 views

.bat file not getting startup

I installed elasticsearch server in my local machine where I don't have administrator access. I try to open the batch file it runs successfully. When I installed the same in a local server with IIS, ...
4
votes
1answer
63 views

Batch File IF Statement Time Taken

I am trying to write a batch file that takes the time taken of a command and converts it into hours, minutes and seconds. Here's what I've got: @echo off set /a sec=0 set /a min=0 set /a hrs=0 for ...
0
votes
1answer
102 views

Open browser window at specified screen / coordinates

A customer has a 6-screen setup for each workstation and would like various pages of a web app to be opened automatically in each of the screens on startup or invoking a shortcut. (The target web ...
0
votes
2answers
176 views

Upload the whole directory with ftp from command line [duplicate]

I've got this .bat file: ftp -s:commands.txt commands.txt: open www.domain.nl username password cd path/to/upload/to/ prompt how can I now upload the folder where I ran the .bat to the server? ...
0
votes
1answer
48 views

Suppressing errors from an embedded command in a batch file for loop

I have a batch file that uses the for command to parse the output from another command, but I want all errors written to STDERR to be suppressed. I have tried this: for /F "usebackq delims=" %%a in ...
0
votes
0answers
230 views

Batch file - Copying folders with percentage

I'm currently trying to create a batch file, which actually copy a folder from a server to a clients machine. And I'm playing around with batch file, using xcopy, and it gives me the percentage of ...
2
votes
1answer
40 views

how to shift all parameters in a batch

The well-know shift command can be used to shift positional parameters in batch file, BUT it does not affect the special variable %*. The shift command has no effect on the %* batch parameter. Is ...
2
votes
1answer
38 views

Attempting to end CMD after Batch File

I am running a Batch file on which is located on my DC. explorer.exe = taskmgr.exe end; end; The batch file works fine and does what I need. The thing is that when I run this batch it forces the ...
0
votes
2answers
85 views

Copying files that match one pattern but not another

I have a number of files that follow a pattern like this: <BaseName> . <Version> [ - <Tag> - <#> ] . <Extension> For example: basename.1.0.0.ext ...