0
votes
1answer
23 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 ...
0
votes
1answer
25 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 ...
0
votes
1answer
36 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
19 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
0answers
12 views

How to hide cmd window of a Calibre Content Server batch script? [duplicate]

So I manage to be able to share more than one Server Content at the same time with the same PC. If someone want to know how can I do this, is easy. Make a batch script and put this: @echo off ...
0
votes
0answers
32 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
35 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 ...
0
votes
2answers
63 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
40 views

Batch file. If statements in if statements

I am trying to write this code: If %dropmode%==on ( If %drop% LEQ %potiondrop% ( set /a potion=%potion%+1 ) If %drop2% LEQ %potiondrop% ( set /a potion=%potion%+1 ) ) So, condition "if %drop2% LEQ ...
0
votes
1answer
44 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 ...
0
votes
1answer
30 views

.bat file to create a Library with icon in Windows 7 and 8

Is it possible to create a .bat file that creates a Library with an icon in Windows 7 and 8. Of course this can be done by following the already created tutorials online like Change Your Windows 7 ...
1
vote
1answer
33 views

batch script to swap words / rename files

could someone help me please? I have win xp and bunch of e-books named like this: Title - Name Surname.mobi and I need a BAT file to get: Surname Name - Title.mobi I am almost able to swap what´s ...
-1
votes
1answer
46 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
88 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 ...
-1
votes
1answer
21 views

Is there a way to read a simple one line asp page using a batch file?

I have a simple asp page in which i write an ip address, and nothing more. Now i need a batch file to read the contents of this page and pass it to a variable. I'm not good with batch files but ...
1
vote
0answers
156 views

Running Batch file from servers network share - using servers local user account

I am trying to create a script that could be run from servers network share and promt me to type servers local username and password as credentials. So, .bat file is located at ...
0
votes
1answer
135 views

7z in batch file with variables “Incorrect command line”

I'm trying to run the following batch file: set HH=%time:~0,2% set HH=%HH: =0% IF %time:~0,2% GTR 5 ( IF %time:~0,2% LSS 21 ( FOR /F "TOKENS=1 DELIMS=:" %%A IN ('TIME/T') DO SET HH=%%A XCOPY ...
0
votes
1answer
29 views

Kill all internet explorer's belonging to the current user

What's the proper way to shut down all of the instances of internet explorer for the current user using batch commands? I have this. There can be multiple users logged into the same computer. What am ...
3
votes
1answer
129 views

Creating a batch OR .bat file to linearize and merge PDFs using QPDF.exe

I am trying to create a batch OR .bat file that will linearize MULTIPLE PDF files. I already have a script I commandeered that uses PDFTK that sends PDFs to the 'sendto' folder where they are ...
0
votes
1answer
53 views

Write a .bat file to select a certain portion of an output of a batch command into a batch file variable

If I run the following command on my windows 7 system (where cable is the name of my network adapter) netsh interface ip show ipaddresses cable I get the following result: Address 10.17.179.17 ...
0
votes
1answer
17 views

Check if an user has given as an input 1 or more then 1 in an batch file

I am having an question with an Batch file Is it possible to let an user choose how many files it will enter? For example set /p count=Enter the number of files you are willing to set: IF %count% ...
0
votes
1answer
41 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
142 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 > ...
1
vote
1answer
1k views

Batch File, PING, errorlevel and > null what do they do?

This seems like a really easy question (running Windows 7). But I have looked for the answer and couldn't find anything at Microsoft's sites (XP PING & Everything else PING) or from a bunch of ...
4
votes
1answer
54 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 ...
2
votes
2answers
59 views

Speed up file search in a network path

I am trying to search in a network path inside a folder of 152.000 documents, list of files to be searched is 1500, after 5 hours it has only found 50 documents. This script was written by another ...
-2
votes
1answer
712 views

Shell files (*.sh) to batch file (*.bat) converter?

It's quiet tedious to convert shell scripts into batch files. Is there a way to automatically and easily perform .sh to .bat conversion or vice versa?
0
votes
1answer
41 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
173 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 ...
0
votes
1answer
105 views

How do I write a batch script that iterates through all png files in all subfolders and does an action?

I'm looking to build a small batch script that executes the command line of pngout.exe So far I've got only this down for %i in (*.png) do "g:\myfiles\_pngout.exe" "%i" /s0 /c6 However, for that ...
0
votes
0answers
109 views

Batch script to get data in an infinite loop and post to a URL

Here is my working script for Unix. It gets data from command line and posts this data to a URL: #!/bin/bash while read line do echo `curl -XGET "http://domain:8080/test/$line"` done I tried ...
0
votes
0answers
11 views

SoX Unable to batch process more than 100 files

I'm using this: cd %~dp0 mkdir converted FOR %%A IN (%*) DO sox %%A -b 32 "converted/%%~nxA" rate -I 192000 pause If I try to drag-drop more than 100 files it simply does nothing. How might I ...
1
vote
1answer
336 views

Launch multiple programs in background on windows 8.1

I want to start (launch) three programs in windows and all of them in Background i.e. No windows. I found two ways (both using vb script to hide a bat) Set WshShell = ...
1
vote
2answers
1k views

How to create multiple folders and name them by reading lines from text file?

I have a plain text file named Export.txt. It contains a list of geographical places, preceeded by a 3 digit number with leading zeros. Example --START OF FILE-- 001 Aberdeen 002 Bellevue 003 Camas ...
0
votes
1answer
50 views

How to define access to just the System event log on Windows 2008 Server

I want to restrict administrator user access to the Security event log, is there a way to do it? I was following this article, but so far no luck.
-2
votes
1answer
53 views

Batch file test for path + file name with extension

Batch file in Windows 7. I want to know how to test for a path + file name with an extension, if it exists or not. I have tried if exists "myfile.ext" It seems not to see the file. Your ...
0
votes
1answer
35 views

How can I simulate Make's targets within a Windows batch file?

In working towards resolving http://tex.stackexchange.com/a/160685/17423, I'm looking to create a batch-file version of this makefile. Is there a clear/conventional way to simulate the 'target' ...
1
vote
1answer
70 views

Commands run in a batch file only when writing cmd /c before

I am running the following command rabbitmq-server.bat" -detached This command runs a sewrver in the background. When I run it from a batch files - the flow stops and later commands in the ...
0
votes
1answer
2k views

Windows Batch file to copy latest files to a new folder

I want to copy the latest file from a Folder and its subfolders to a new location. The following code works well, BUT I do not want to filter by Date AND Time (/O:D), but DATE only, so that all ...
1
vote
1answer
142 views

How do I create a .bat to logoff a specific user from your pc?

Running remote desktops that are acting as specific users on Win7x64. The main username I'm using is Server. And the rest are as follows hh1 hh2 hh3 etc. Basically these handheld remote desktop ...
2
votes
2answers
427 views

Run a batch file when I lock/unlock my computer

Is there a way I can run a batch file upon locking my computer, and then run another batch file when I unlock it? (Windows 8.1) Thank you!
0
votes
0answers
38 views

How to start an application in a given directory, using other as its working dir?

For a system we are deploying for our customer we need to run the setup executable from %temp% and have it use for the installation, files in another directory. This cannot be solved at the ...
0
votes
1answer
113 views

Delete a file inside subfolder using bat

I know the name of the subfolder inside which the file I want to delete is located. The name of the subfolder is "My Subfolder" and the file I want to delete inside the subfolder is "The-Bad File.txt" ...
0
votes
1answer
256 views

How to extract part of a string between 2 delimiters, in Windows batch file?

I have a variable length string starting with START and ending with END as delimiters. I want to extract the string between START and END. I tried doing SET _result=%String:~6,-4% ECHO %_result% ...
1
vote
2answers
332 views

Check Multiple if conditions in bat file/ and operator in bat

I want something like this:- if %ERRORLEVEL% GEQ 1 && %ERRORLEVEL% neq 255 GOTO Not closed by user . But this syntax is not working.
1
vote
2answers
437 views

How to schedule taskkill in bat file

I want something like this:- taskkill 7z.exe after 50sec. code 1 code 2 code 3 7z.exe will be killed after 50 sec but the program should execute code 1 code 2 code 3 without waiting for the ...
0
votes
1answer
1k views

Create a Batch file (.bat) to search an string through multiple files

I am using Windows Server 2008 and I need to create a Batch file (.bat) to search for a given string in 20.000 to 30.000 files located all in one folder in the same level (without subfolders). I have ...
0
votes
1answer
199 views

Bat file fails when file name has spaces

I have this batch file that process some video files in a batch. Things work just fine as long as the filename has no white spaces in it's name. If the file name (test movie.avi) has white space it ...
2
votes
2answers
1k views

batch - File last modification time with seconds

I want to know when a file has been modified for the last time. I can get these infos using the following batch script: FOR %%i IN (myfile) DO SET modif_time=%%~ti The problem is that I need ...
1
vote
1answer
238 views

Running vim script exits batch file? (Windows .BAT/.CMD)

Trying to run a vim script as part of a batch file with vim -u NONE -S dothis.vim but what is puzzling is that the batch file exits after this line instead of continuing with the next statement. ...