Most languages support such output, but since I don't know what language you are working with, it's hard to comment further on that part. The program's output needs to be directed to the console StdOut device for this to work. įor /f "delims=" %%i in ('pathspec\yourprogram.exe arguments') do set pf=%%i That the executable is named between single quotes, something like this. If the batch procedure invokes the executable - and you have control of the operation (coding) of the executable - the FOR with it's /F switch can be used without resorting to an intermediate file, much like you did with the file. With regard to communicating with a batch procedure, it depends on whether the batch calls the executable or the other way around. Then responders can eitherĬorrect your attempt or address the bigger problem. It might speed things next time to describe the bigger problem first and add the approach you had tried as an example. I guess this is basically a loop but I need some assistance with the syntax.OK, you didn't mention anything about an executable in your original description of the problem. The permission process takes a long time but I want the batch file to process the next line of the text file without waiting for the first process to finish. This works but I want it to read through each line of the text file and run. For example my batch file is as follows: set /p hostname=variables.txt set /p backupdrive=variables.txt set /p backupdir=variables.txt set /p xbackupdir=variables.txt This does not work because it is only reading in the first line each time, so each. I have a batch file that I would like to read in each line and set each line to a variable. The variables will remain defined with the data from the last line of the config.txt after the batch file ends. The FOR loop will then read the next line, and repeat the process. The FOR loop will read one line, assign data to variables, then you can process the variables. Bash Script Read Line From File Shell Script Read Line From File. Get the first line of a text file and set it to a variable in. Parsing a string variable in a batch file for LAPS / ADU
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |