For loop Related Problems & Solutions

20 tags
Refine Tags
Search Tags:

Start a discussion

Results 1 - 20 of 20
[Solved] Get files date stamp within for loop
Summary: Hi guys, please help me find the date stamp of a file within a for loop. Below is my code. Thank you. (Apologies if I am meant to embed code, it has b...

[Solved] how to get output from two for loops?
Summary: Hi all, I have the following input.txt file: tr=min;JohnLoeffler te=min;TimWalter The aim of the batch file I want is to give me: tr min;John...

[Solved] FOR loop - variable number of lines to skip
Summary: I'm working on a batch script where I use a variable to tell the FOR how many lines to skip. for /f "skip=!lines! tokens=1-3* delims=," %%A in...

[Solved] Batch get powershell version
Summary: I'm working on a batch file that checks for which powershell version is installed. The PS get-host command outputs something similiar to this: Name ...

[Solved] Batch: For loop to read only lines starting with character
Summary: Alright, so I need to make a for loop that ALMOST works like this: for /f "EOL=:" %%A in (file.txt) do echo %%A The thing is that I ...

[Solved] Using FOR to execute commands from non-bat file
Summary: Allright. I have a file. It's not a .bat. Inside it, there is a small set of commands, along with some other stuff which is commented out with ";". I ...

[Solved] Creating a FOR loop to replace certain letters in a variable
Summary: I am creating a backup program. It is to create a folder named after the date and time of the backup and copy a folder into it. I use %TIME% t...

find all files in dir and import 5 lines from each txt file
Summary: Hi guys, I need to search a directory for all the files in it, and for each file in it assign variables to each line of text. These files will be bein...

[Solved] For loop cacls permission editing
Summary: How would I change every folder in a drive that says "Design" to only have read permissions for "Domain Users" group? I have messed around with some f...

[Solved] How to use a for loop to check if a variable equals a set of
Summary: I would like to create a for loop that will check if x is equal to 40-80 Right now I'm using this going to 80 if %x%==40 ( goto regular ) if %x%==41 ...

[Solved] Set unknown number of variables a variable\number
Summary: hey all... I have a for loop: FOR /D %%G in (user*) DO ( echo %%G >> list.txt ) pause which will give me a list of folders with user...that works fine...

[Solved] IF Loop in FOR Loop - Batch script
Summary: As of now i perform a operation using batch like below. FOR /D %%G in ("*") DO command -- this exeuctes the command on all the folders as i have ment...

[Solved] For /F /L using a single for loop?
Summary: How do I do for /f and /l both using a single for loop? I have to so some file operation for a specific count increasing dynamically. I am not sure i...

[Solved] For loop, windows cmd
Summary: I'am using Windows cmd to calculate some variables. The command works fine: gut adapt_gf -InFile sla1.nc -OutFile sla_grid1.nc. However, I have many ...

[Solved] CMD Batch newbie here...
Summary: Hey guys, why is this not working? The purpose is to automatically run a command using parameters from local filenames. The probkup line works fine is...

How to put DayOfWeek value into file name?
Summary: I would like to use the numerical part of the output of "wmic path win32_localtime get dayofweek" to number backup files. Something along the lines of...

For Loop Help!!!
Summary: Write a c++ program to ask the user for two integers, first and last; then write a 'for' loop that will print all integers in the range[first, last] t...

FOR /F command and ERRORLEVEL
Summary: Hi, I was just wondoering, is there a way of getting the errorlevel from a command given to the FOR /F command? Example: setlocal enabledelayedexpansi...

How to do a nested FOR loop?
Summary: Here's my goal: 1) grab name1 in LIST.TXT, which is a text file with 20 computer names. 2) Find the computer on the network, go to Logfile.txt and f...

how to echo to screen in a FOR loop?
Summary: Let's say I was using the following FOR loop: @echo off setlocal EnableDelayedExpansion FOR /F %%z IN (list.txt) DO ( set line=!date! !time! %%C p...

1


Ask Question