updating the date in an output file
Posted: 27 Mar 2015 09:44
FINDSTR "^%computername%$ %date%$ %username%$" < %DESKTOP% >NUL || ECHO %computername% %date% %username%>>%DESKTOP%
Hi,
Hoping for some help here. The above batch code I use as part of an install script to silently install some software and do various other things to automate the process.
%DESKTOP% is just a variable pointing to a txt file where the out put looks like "XP-4A2A79EF62D3 27/03/2015 Admin". I didn't want multiple entries of the PC name if the PC had the software re installed, so made it so that if the entry was found it didn't repeat it. However I've since found if that PC had the software reinstalled later on I'd like the date to change to the new new install date.
So ideally my log file looked like this when I left
PC-OFFICE 27/03/2015 Admin
but if the software was re-installed on a later date I'd like the same line in the log to change the date so it would be
PC-OFFICE 29/06/2015 Domain.Admin (and if it was a different user name too)
Hope that makes sense thanks !!
Hi,
Hoping for some help here. The above batch code I use as part of an install script to silently install some software and do various other things to automate the process.
%DESKTOP% is just a variable pointing to a txt file where the out put looks like "XP-4A2A79EF62D3 27/03/2015 Admin". I didn't want multiple entries of the PC name if the PC had the software re installed, so made it so that if the entry was found it didn't repeat it. However I've since found if that PC had the software reinstalled later on I'd like the date to change to the new new install date.
So ideally my log file looked like this when I left
PC-OFFICE 27/03/2015 Admin
but if the software was re-installed on a later date I'd like the same line in the log to change the date so it would be
PC-OFFICE 29/06/2015 Domain.Admin (and if it was a different user name too)
Hope that makes sense thanks !!