I have figured out there are two lines that it writes to the files %variable%.txt So when %variable%=%computername%.txt the resultant file would be Computername.txt.txt
The program is writing correctly now, but all that displays is the screen showing what has/has not installed. It appears stalled and I see no progress. Is there a way we can see what is installing as it is being installed?
I doubt the corrections you made are fixing anything. Seems you misunderstand the operation of what the script is doing. The delimited file of Computername.txt.txt is not a mistake, but rather deliberate with adding a 2nd extension on the original filename to create another filename for use. Example: Computername.txt is created with initial information. The information is used and changes are recorded to Computername.txt.txt. At the end of the script, Computername.txt.txt is moved over to overwrite Computername.txt. This is done as the script can not read and write to the same file with out messing it up. So Computername.txt.txt is actually a temporary file that later replaces the original file named Computername.txt. Perhaps I could have made a temporary filename more unique though I chose for an easy method.
I could summarize the script though you may not be able to link what words to what code. I will rather comment the code more and so that you can see what each line of code is doing. I included the pause at the end of the script and the progress output like how Yzöwl mentioned.
Heavier commented code:
Edit: Upon review and to avoid further confusion with the .txt and .txt.txt use of file handling, I have done a small change by using .txt and .txt.tmp as the later has a better reference to actually being a temporary file.
Edited by MHz, 21 February 2015 - 08:43 PM.