0
votes
0answers
18 views

How can I batch convert subfolders of images into single PDFs?

I'm surprised I couldn't find an easy script for this online. I have a directory with lots of subdirectories, each filled with TIFFs. How can I batch convert subfolders of multiple images (TIFFs) into ...
0
votes
1answer
32 views

How to access cmd of another computer from my computer's cmd?

How can I access the Command Prompt of another computer from my own computer's Command Prompt in Windows7? I am hoping that I can do something like that into a batch file: Enter \\ComputerA -u John ...
1
vote
2answers
47 views

Batch file, skip a step if an error occurs

I'm trying to write a script that automates copying some files from two external locations using Robocopy. I want the script to skip a step if one of the locations is unavailable. I'm using the ...
0
votes
1answer
34 views

I'm trying to run a batch file that test for 4 different files then based on the correct file present it runs the correct command

:: batch file to run backup @echo off setlocal set backup1=="F:\my backups\Disk_1_DataBAckup" set backup2== "F:\My backups\2_backup_data_to_disk2" set backup3=="G:\my backups\3_backup_data_to_disk3" ...
0
votes
0answers
26 views

Batch Files - Script

I have a little .cmd script that executes few commands like mapping network drive, output some info to log file and copy the file on network including renaming the title based on date/time. This ...
1
vote
2answers
48 views

Can I use shell: commands to change directory in CMD?

I am trying to create a batch file which installs favorites on all company PCs and Notebooks. Is it possible to change the directory in CMD using shell:favorites? I need this because on the ...
1
vote
0answers
41 views

Nested environment variable does not expanded

I can't explain the below strange issue. I have two system variables: PYTHONHOME = D:\Tools\ISDC_Tools\Scripting\Python.2.7 PYTHONPATH = %PYTHONHOME%;%PYTHONHOME%\Lib After creating a new cmd ...
2
votes
1answer
46 views

Windows Batch - default choice with timeout

In a cmd window, I want to prompt the user for a set of choices (denoted by letters), one being the default. The user can key in a letter or hit Enter, in which case the default choice will be ...
1
vote
1answer
106 views

run .hta as adminstrator

Simple question how do you run a .hta file as an admin? When I try running runas /user:Grants-laptop\administrator computerinfo.htafrom command line I get this error: RUNAS ERROR: Unable to run - ...
0
votes
0answers
8 views

Build and run VC++ project with batch script

I want to build Visual C++ projects in both debug and release mode and then execute them with a single batch file. How can this be done?
0
votes
1answer
45 views

How can I create a batch job (.bat) that zip a folder?

From 7zip I've downloaded their command line tool 7za.exe, and I have to following script: echo off cls set zip ="C:\7za.exe" set filename="%date%.backup.zip" set pathtobackup="C:\MyDocs" %zip% ...
1
vote
1answer
86 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 = ...
2
votes
1answer
99 views

How to compare 2 strings in batch and determine if variable is alphabets

I have this code for /l %%a in (0, 1, 25) do ( if /i !TextAlphabet!==!Alphabet[%%a]! ( set AlphabetNumber=%%a ) ) !Alphabet[]! is an array containing alphabets. I tried echoing !TextAlphabet! and ...
0
votes
3answers
97 views

Get administrative right in windows command line [duplicate]

I am not trying to do cheeky things, but my need is just to have two scripts for adding or removing IP routes using the following command in batch scripts: Add route: @echo off route add -p ...
0
votes
4answers
59 views

Part filename to folder

I've been trying to figure out how to make a dos command that can "see" part of a file name, then create a folder and sort every file which has that part of a filename in it. Every filename has the ...
0
votes
1answer
58 views

Understanding a for loop in a batch file to rename files by replacing strings

@echo off Setlocal enabledelayedexpansion Set "Pattern=rename" Set "Replace=reuse" For %%a in (*.jpg) Do ( Set "File=%%~a" Ren "%%a" "!File:%Pattern%=%Replace%!" ) This renames .jpgs having ...
1
vote
2answers
71 views

How can I start a VirtualBox VM and then run a batch file inside the VM

I have a lengthy build operation which calls several batch files in succession. Most of these batch files start 32-bit compilers, etc, but one of them involves running a legacy MS-DOS 16-bit app ...
1
vote
1answer
62 views

Win7 Task Scheduler Won't Run Copy Commands

I'm trying to run a patch file every morning at 4am. For whatever reason, the lines in the batch file that use robocopy.exe are skipped. I've also tried xcopy and cp(from UnxUtils). The batch file ...
0
votes
0answers
32 views

Export/Convert PNG to HTML table using GIMP batch mode in Windows 7

I need to convert PNG images to HTML tables in GIMP batch mode from the Windows command line and have been unsuccessful using google to find an example I can reuse. I can open the PNG in GIMP and ...
-1
votes
1answer
232 views

“CACLS” is not recognized as an internal or external command, operable program or batch file

I have been using CACLS batch file many times and today it is not recognized. CACLS.EXE exist in C:\Windows\System32 and I have tried writing at command prompt: CACLS * /E /T /C /G Administrators:F ...
0
votes
0answers
35 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
54 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
35 views

Restart Service on Remote System Batch

Just having trouble with a batch and need some clarification on 'IF', 'ELSE' and 'GOTO' @echo off sc \\RemoteServer stop "My_Service" :query sc \\RemoteServer query "My_Service" if %state% == 1 ...
0
votes
1answer
159 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
103 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
115 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
222 views

How to show extraction progress of 7zip inside cmd?

7z.exe do not show any extraction progress in cmd."C:\Program Files\7-Zip\7zG.exe" -y x -pPASSWORD "D:\Myfile.rar" Extracts the file with a GUI progress-bar. But I don't want a GUI progress bar. I ...
1
vote
2answers
160 views

Use Batch findstr for files with whitespaces

I'm trying to search for a string in a given file. This file can have whitespaces in its name and I'm having trouble with the Batch file. I can easily do this by console getting the correct results: ...
0
votes
1answer
157 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
2answers
137 views

Looking to create a batch file capable of editing a line (or word) in a text file

I have a text file (...\config.txt) containing 2 lines which looks like: Preamp: -4 dB Include: surround.txt I need to change "surround" to "headphones" in that config file. I really need to make 2 ...
0
votes
2answers
78 views

Make Batch File Cmd Window Stay Open For X Seconds

I'm running a batch file on a server to dump a MySQL database. I'd like to have the cmd window stray open for, say, 20 seconds, and then close. That's so if I run it manually I can see that it ...
0
votes
0answers
38 views

how do you monitor the progress of a command line program?

We have some custom command line programs at our Windows shop. These commands are scheduled to run (from within bat files) at regular intervals using the Task Scheduler. Our tasks pull data from ...
1
vote
1answer
114 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. ...
1
vote
2answers
56 views

Stop a “completly hidden batch file”

I'm running Windows 7 64 bit Home Premium. My new internet connection is a bit buggy, and I need to keep reconnecting. To make sure my computer keeps connected while I'm away, I created a script that ...
0
votes
1answer
115 views

writing a batch file: having a batch insert a command into another cmd-based program

i'm trying to have my batch open another cmd based program, wait some time, then input some commands into the cmd-based program, but can't find any documentation on how to do it. this is the batch ...
-1
votes
1answer
43 views

Removing folders with a batch-file

You will probably recognize the script below especially this command which was posted here over a year ago: for /f %%i in ('dir /a:d /s /b *PGP Corporation*') do echo rd /s %%i However, I am ...
0
votes
3answers
158 views

Need help in extracting info from multiple html files [req: batch/c++/notepad script]

I have about 100+ files from which I need to extract certain info and copy them to separate files. They're all html files, and have html coding. File format: <html> <head> ... ... useless ...
0
votes
2answers
77 views

Concrete cases for CMD/BATCH use [closed]

Please excuse my inexpertise. I don't have much experience with the command line. From my searches, the main reason for CMD use(*) is automation. I haven't, though, found concrete cases. Most ...
0
votes
1answer
43 views

batch file to display nicely compare files results

I'm looking for a batch code to prepare a file with the differences between two files in a nice way, Maybe highlight individual lines in a different color, Does anyone have such a script?
0
votes
0answers
244 views

Windows batch “rmdir /s /q” empty a folder but it is still there (but 0KB) and can't access

I use Windows 7 x64. I have a svn checkout Working folder, say "Working". When I use a batch file or just open CMD, I did del "%currPath%\Working" /s /f /q rmdir "%currPath%\Working" /s /q The ...
4
votes
1answer
303 views

How to determine if process in windows “has no parent”?

I am trying to figure out a way through the Windows command line to determine if a process has no parent. I know all processes technically have a parent that is controlled by the OS or whatever, but ...
1
vote
2answers
96 views

Detect a change in the number of files or folders

The following script is supposed to check if the number of files and folders has changed since the last time the batch-file was run. If so, it prints a message and updates the counts. Unfortunately ...
0
votes
2answers
179 views

Can't quite get my batch file running invisibly

I found a lot of stuff online about creating invisible bat files. I came closest to wrapping my mind around this one: Run a completly hidden batch file However, in my application, I can't figure out ...
1
vote
1answer
137 views

How to get the command that invoked a task with tasklist?

The Windows task manager has a column labeled Command Line that shows the command that started the given task, with all the switches and parameters, for example: test.exe -V -A 127.0.0.1 -P 6062 ...
0
votes
2answers
201 views

How to search and replace a string in multiple text files (within a directory) with Windows CMD? Part 2

This is in relation to this question . Unfortunately, PowerShell scripts are disabled on the system I am working on. I can't even use a simple (Get-Content). I did figure out how to do change ...
2
votes
3answers
165 views

How can I start a process and give it a different name in Task Manager via a batch script?

I have a batch file that looks like this: cd C:\Some\Folder wperl SomePerlScript.pl %* exit 0 It's basically designed to work around the fact that perl.exe leaves an annoying command prompt window ...
1
vote
0answers
665 views

Launch Minecraft 1.7.2 From Batch File and change Username

Near the start of the year I made a series of little batch scripts allowing people to run minecraft off of their usbs and not leave anything on the computer (symlink from %appdata%/.minecraft to ...
0
votes
1answer
67 views

How to restart batch file itself?

How to restart batch itself automatically? If the filename of batch changed, start <fixedbatchfilename> must fail because though the filename changes, the command doesn't. Is there a ...
2
votes
1answer
81 views

Unbalanced Parenthesis in a for loop in batch

@echo off FOR /l %%A in (0,1,30) do ( set /a results=1600 + !RANDOM! %% (1900 - 1600 + 1)echo %%A--!results! ) When I run this I keep getting error "Unbalanced parenthesis" in windows xp and when I ...
0
votes
1answer
58 views

%RANDOM% environment variable is giving a single number [duplicate]

I’m having trouble with the %RANDOM% environment variable in the following command: FOR /l %%A in (0,1,30) do set /a results=1600 + %RANDOM% %% (1900 - 1600 + 1) && echo %%A--!results! I ...