Output problem
Posted: 06 Aug 2010 04:27
Hi all,
I have a big problem with a batch file
.
I copied this script in all the workstation of my network. I use to execute it remotely from my PC every week:
This is the code:
In :LISTA, the batch audit the windows registry for all installed software and save it in a txt file.
For Example:
I'm trying to write it all in one row without success. I need only one file with one computer for each row and not like now, one file for every computer.
For example:
Any Idea??
I hope to solve this problem
Thanks guys.....
I have a big problem with a batch file

I copied this script in all the workstation of my network. I use to execute it remotely from my PC every week:
This is the code:
Code: Select all
@echo off
set DC=\\COMPUTER
set data=%date%
set ora=%time%
set dati=%DC%\SOFTINST$\LOG\%COMPUTERNAME%.txt
set prgs=%DC%\SOFTINST$\%COMPUTERNAME%.txt
set fooreg=%temp%\foo.reg
set footmp=%temp%\foo.tmp
set foolog=%temp%\foo.log
set foolist=%temp%\foo.list
:LOG
REM Creazione log macchina e interrogazione sistema
if exist %fooreg% del %fooreg%
if exist %footmp% del %footmp%
if exist %foolog% del %foolog%
if exist %foolist% del %foolist%
echo Nome Computer: %COMPUTERNAME%>> %foolog%
echo Data ultimo aggiornamento: %data%>> %foolog%
echo Ora ultimo aggiornamento: %ora% >> %foolog%
IF EXIST %dati% GOTO DELETEOLDLOG
type %foolog% >> %dati%
del %foolog%
GOTO LISTA
:DELETEOLDLOG
erase %dati%
type %foolog% >> %dati%
del %foolog%
:LISTA
REM Interrogazione sul software installato.
echo "%COMPUTERNAME%.txt" >> %footmp%
regedit /E %fooreg% HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
type %fooreg% | find """DisplayName""" >> %foolist%
for /f "tokens=2,3 delims==" %%a in (%foolist%) do (echo %%a >> %footmp%)
del %fooreg%
IF EXIST %prgs% GOTO DELETEOLDLIST
type %footmp% >> %prgs%
del %footmp%
GOTO EXIT
:DELETEOLDLIST
erase %prgs%
type %footmp% >> %prgs%
del %footmp%
:EXIT
echo.
echo TRUE >> C:\TRUE.CK
GOTO :eof
In :LISTA, the batch audit the windows registry for all installed software and save it in a txt file.
For Example:
"WORKSTATION.txt"
"Windows Driver Package - Intel (Serial) Ports (07/06/2009 5.5.1.1012)"
"Windows Driver Package - Intel System (05/27/2008 9.0.0.1009)"
"CCleaner"
"Cronos ZERO12 Monopostazione 3.1.1"
"DameWare Development Mirror Driver Uninstall"
"Defraggler"
"DWG TrueView 2011"
"Windows Driver Package - Intel System (09/15/2006 7.0.0.1011)"
"Windows Driver Package - Intel USB (02/25/2008 9.0.0.1005)"
"Windows Driver Package - Intel System (02/25/2008 9.0.0.1005)"
"GoldenDict"
...
...
I'm trying to write it all in one row without success. I need only one file with one computer for each row and not like now, one file for every computer.
For example:
"WORKSTATION1.txt";"SOFT1";"SOFT2";"SOFT3";"SOFT4";...;...
"WORKSTATION2.txt";"SOFT1";"SOFT2";"SOFT3";"SOFT4";...;...
Any Idea??
I hope to solve this problem

Thanks guys.....