📎 AI Summary:
Lubomir seeks a way to run multiple commands sequentially from a text file on Windows 7 without programming experience. Neemobeer suggests using PowerShell to automate running several executable files with associated data files. Lubomir thanks him for the assistance.

Lubomir

New Member
Member details
Joined
Jul 10, 2017
Messages
2
Thread Author #1
I would like to write some commands into one file and then I want the command line to read the file and do all commands inside the file. Step by step. For example:

C:\Users> project1.exe < text1.txt > data1.txt
C:\Users> project2.exe < text2.txt > data2.txt
C:\Users> project3.exe < text3.txt > data3.txt
Now, I have to write it step by step. I am using Windows 7 Home Premium. I am not a programmer.

Thanks for help.
 

Solution
Powershell would be easier
Code:
$projCount = 3

for ($i=1; $i -le $projCount;$i++)
{
    $commands = Get-Content "text$i.txt"
    
    foreach($command in $commands)
    {
        Start-Process "project$i.exe" -ArgumentList $command -RedirectStandardOutput "data$i.txt" -Wait
    }
}

Neemobeer

Windows Forum Team
Staff member
Member details
Joined
Jul 4, 2015
Messages
8,995
Powershell would be easier
Code:
$projCount = 3

for ($i=1; $i -le $projCount;$i++)
{
    $commands = Get-Content "text$i.txt"
    
    foreach($command in $commands)
    {
        Start-Process "project$i.exe" -ArgumentList $command -RedirectStandardOutput "data$i.txt" -Wait
    }
}
 
Solution