0
votes
0answers
24 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
40 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
78 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 ...
3
votes
1answer
99 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 ...
1
vote
1answer
57 views

Opening a text file in notepad++ and refreshing it at regular interval of time using a bat file

i want to open a text document in notepad++ through bat file which i have achieved . this is the command i am using to open a file. %SystemRoot%\explorer.exe "D:\path of file\file.log" Secondly as ...
0
votes
1answer
78 views

Adding prefix to bulk filenames in batch file

Ok so i am trying to add a prefix to all filenames in a folder. After a couple of days of searching the internet I actually came up with something that worked perfectly....almost!!! echo ...
0
votes
2answers
76 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
28 views

Get directory by filename

My batch script receives a filename with full path (eg.: C:\...\file.c) as first argument. I need to get the directory of that file and go to the directory, much like: cd C:\...\ How do I do this? ...
0
votes
0answers
75 views

Getting a batch file to run windows 7 psr tool

I'm trying to run the Windows 7 problem steps recorder tool on a remote computer using screenconnect. Screenconnect allows you to quick launch files remotely, so I'm using batch files. The goal is to ...
0
votes
1answer
36 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
116 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
1answer
39 views

Looping batchfile with counter

Ok, I know the loop part is invalid, but hopefully helps give an idea of what I want to do. Ultimately, I want to get prompted for the 3 values (commented out the prompts for now and hard coding for ...
0
votes
2answers
89 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
35 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
133 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
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
0answers
26 views

How to view file activity (from the command prompt)?

I want to see who recently saved a large number of files to a shared folder on our network, and if I recall, there's a way to print file activity from the last week for example in the command prompt. ...
0
votes
1answer
84 views

Command line - Some questions

I've created a batch file for zipping selected items in a folder. (The file is placed in 'Send to'). If I use the following code: for %%* in (.) do set CurrentFolder=%%~n* "C:\Program ...
3
votes
1answer
265 views

Disable close button on DOS program in Windows 7

At my company we have stores that run some old DOS software. Before Windows 7 you could run these programs in full-screen and now you cannot. I know there are work-arounds to get in full-screen ...
0
votes
2answers
75 views

Windows Command Prompt [closed]

How to load a prewritten line in command prompt? Example: Take the followings as a line: java -jar System.jar Can this command line be written in a .bat file so that by clicking on the .bat ...
1
vote
1answer
280 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
151 views

How to avoid mkdir path redirected to SysWOW64

I'm tring to create some directories (dirs) using a .bat file. At the cmd.exe, I can create the dirs normally, but when runing the commands inside a .bat file, for some odd reason, the dirs are ...
0
votes
0answers
74 views

Runas weird functionality with command line

I have a .bat file I use to launch some programs. Some of them require elevated privileges (i.a. a devcon-based does-device-exist check), but some don't. So, I run the .bat as administrator, and use ...
0
votes
0answers
37 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 ...
1
vote
2answers
4k views

Batch file with commands to run as administrator and standard user

I'm trying writing a batch file that needs to run some commands using a local admin account (start/stop a service) and some commands using the logged in user (copy files from the user directory) and ...
0
votes
3answers
6k views

Run Batch file as administrator [duplicate]

I created a batch file which stops a service,then stops a process and then starts the service it stopped. When I execute the batch file, it says "access denied". I cannot figure out why it says ...
0
votes
1answer
100 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
242 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
272 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
349 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
806 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 ...
1
vote
0answers
42 views

How to hide error dialog box in 7zip?

I am using "C:\Program Files\7-Zip\7zG.exe" -y x -pmypassword "D:\Myfile.rar" -o"D:\Extracted Files\" for extracting a file encrypted with password. Now if 'mypassword' is not the correct password ...
0
votes
4answers
3k views

Make batch file run in the background of the command prompt while continuing to use command prompt

I am use a windows command prompt for hours a day at work, and I want to spice things up. I want my text color to change color every 1 second. I have a batch script that does this. @echo off set ...
1
vote
1answer
213 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. ...
0
votes
2answers
373 views

compare two directory (each with multiple sub-directory and folder) and find files that are not present in either one of them in windows

I want to compare two directory (including subfolders) for files (for example pictures) in two separate drives. I have thousands of files and are hidden inside subdirectory and folders. Small: ...
-1
votes
1answer
61 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
1answer
57 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
1answer
257 views

Batch to prompt for folder name and command, redirect to TXT file

What I'm trying to accomplish, is to have the batch file prompt the user to input their specific folder on our team's directory, and then prompt for a specific command to be used, and redirected to a ...
1
vote
2answers
109 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
256 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 ...
2
votes
1answer
115 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
72 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 ...
0
votes
0answers
177 views

whats a good way to format event log (wevtutil) results?

wevtutil qe Application /rd:true /c:10 /f:text this returns the following (partial): Event[7]: Log Name: Application Source: SceCli Date: 2013-11-14T04:13:03.000 Event ID: 1202 Task: N/A ...
1
vote
0answers
152 views

How can I modify the BAT file in this post so it will randomly select 1 background contained in a folder containing multiple backgrounds?

Is there a way to modify the bat file from this post here: How do I set the desktop background on Windows from a script? so that it will randomly select 1 background image from a folder containing ...
3
votes
3answers
2k views

What does the percent sign (% and %%) in a batch file argument mean?

I think I'm missing something because I can't seem to find what this means. Example: for /D %%A in (*) do "\7za.exe" u -t7z -m9=LZMA2 "%%A.7z" "%%A" That line was supposed to use a command line ...
0
votes
0answers
65 views

How can I get the Windows command line to ignore the “set” reserved word?

I'm running an IIS command on a remote server via PSEXEC. the command I'm running has the "set" keyword, which is a command-line reserved keyword. My command looks like this and throws an error. ...
0
votes
2answers
172 views

Batch file to create many files with special characters

Essential info: I have a file "DB_OUTPUT.TXT" with 304 lines that I need to turn into 304 files (one per line). Each line contains many special characters and may be up to tens of thousands of ...
0
votes
2answers
1k views

Batch IF .exe is not running

I am trying to create a batch that IF program.exe is not running in process, it will run code below. In vb.net this is easy, but I do not want to create a program. I am guessing a VBS script would ...
0
votes
0answers
25 views

Is there a way to create a script/BAT that changes my desktop image… if so how? [duplicate]

Okay so I just got this program that lets me lock my PC screen (this info doesn't matter much) anyways... You can run files when the program starts/locks and closes/unlocks. What I would like to do is ...
2
votes
2answers
213 views

Ansicon vs. Batch File

I am attempting to make a colored command prompt in Windows 7. Using ansicon, I have successfully managed to create the prompt. However, when I put the commands into a batch file, I receive an ...