Tagged Questions
1
vote
2answers
23 views
Redirect output of command in for loop of batch script
...
for /F %%F in ('dir /B %* 2> nul') do (
...
What I'm attempting to do here is discard the err output of the command (and loop over the stdout output). However, it complains:
2> was ...
0
votes
1answer
54 views
Extracting IP from ping into variable in bat script
is there anyway i could do this?
@echo off
REM #Testing FIND in IPCONFIG
setlocal EnableDelayedExpansion
for /f "tokens=3" %%a in ('ping localhost ^| findstr /i "reply"') do (
set address=%%a
...
0
votes
2answers
13 views
Registry editing using CMD , Path isn't added
lets start by giving you my code:
@echo off
echo.Add App Shortcut for use with
echo.Windows+R
echo.A.K.A Windows "RUN" Command
echo.===========================
color 0E
echo.Make Sure you do not run ...
0
votes
2answers
56 views
bat script working on windows 7 but not on windos 2k8
I have a script which works on windows 7 but not on 2k8 throwing up an exception of file not found.
@echo off
REM #Testing FIND in IPCONFIG
SET VIPTHATWORKS="11.11.11.11"
SET ...
0
votes
3answers
33 views
Windows batch script to unzip files in a directory
I want to unzip all files in a certain directory and preserve the folder names when unzipped.
The following batch script doesn't quite do the trick. It just throws a bunch of the files without ...
0
votes
1answer
22 views
Java: Running cmd commands (multiple commands with multiple arguments at once)
I run cmd (command line) and running my batch file from Java this way:
final String cmd = "cmd /c C: && dir && cd C:\MyApp\Maxi && dir && C:\MayApp\Maxi\deploy.bat";
...
0
votes
1answer
24 views
I want to loop through a file assigning a variable to specific tokens, then use the variables in a command line
I am a newbi and apologize if I am not asking the question correctly, but I want to loop through a list, assigning a variable to specific tokens in that list, then pass the variables to a command ...
1
vote
2answers
42 views
Running an .exe file through a batch file and passing parameters
I have an .exe file that takes two parameters when i run it from the command line, as such:
test_app.exe -vid.avi -data.txt
How would i be able to START the .exe file through a batch script and ...
0
votes
3answers
42 views
Batch file for loop unable to assign values from external file
So, I've got this basic text file called prev_batch.cfg that I want a batch script to read. prev_batch.cfg is a single line of text, but tokens are delimited with a comma. It looks something like:
...
0
votes
1answer
27 views
Restore a running application from batch file
I have a Windows Photo viewer opened and minimized.
How do I restore it to the foreground from a batch program?
I figured out that the application is "dllhost.exe"
I tried this command:
START ...
0
votes
4answers
33 views
Translating shell script into Windows command shell script (batch)
I have a shell script which makes directories week_01 to week_09 using a for loop and one another directory called week_10. I want to translate this shell script into Windows commands using two lines ...
1
vote
1answer
25 views
Command line loop through directories
I'm trying to write a batch file that will be run on a parent directory and will loop through subdirectories removing all but the newest 3 files from each subdirectory. What I have now recurses ...
0
votes
2answers
41 views
batch file acts differently when launched from within another batch
So... hey guys and gals. I have the weirdest problem. I wrote this batch file which generate a text file
My code which for some reason gets really messed up is bellow, you can see a better version ...
0
votes
1answer
23 views
.cmd program starts files in a command prompt
I have a simple script to change a file name and open an excel macro concerning said file to do operations on it. When i run it, the file opens in a command prompt titled, "FM-001761-01 Substrate ...
1
vote
1answer
28 views
goto unexpected with blank choice
My problem:
I set a VAR with prompt and three IF to let choice.
Fourth choice doesn't work. I would like that if i push enter without type anything, it goes back to :MOSTRA.
Actually leaving it blank ...