Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a PDQ installer which registers 2 DLL files and logs the results to a network share. If I run the PDQ on 1 machine it echo's the computer name fine, however if i run the installer on multiple machines, it only echo's the first name and not the rest.

The batch file is as follows;

echo %computername% >> "\\\servershare\software\Admin\IT_Support_Utilities\PDQ Deployment\Logs\agent_logs.log"
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe /codebase /tlb "Agent.dll" >> "\\\servershare\software\Admin\IT_Support_Utilities\PDQ Deployment\Logs\agent_logs.log"
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe /codebase /tlb "MySql.Data.dll" >> "\\\servershare\software\Admin\IT_Support_Utilities\PDQ Deployment\Logs\agent_logs.log"

The output is below for a run on 2 machines; WRCREC274 is the name of the first machine. The horizontal line separates where the next batch file begins

WRCREC274 

Microsoft (R) .NET Framework Assembly Registration Utility 4.0.30319.1
Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.

Types registered successfully
Assembly exported to 'C:\WINDOWS\system32\Agent.tlb', and the type library was registered successfully

Microsoft (R) .NET Framework Assembly Registration Utility 4.0.30319.1
Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.

Assembly exported to 'C:\WINDOWS\system32\MySql.Data.tlb', and the type library was registered successfully
----------
Microsoft (R) .NET Framework Assembly Registration Utility 4.0.30319.1
Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.
Types registered successfully

Assembly exported to 'C:\WINDOWS\system32\Agent.tlb', and the type library was registered successfully

Microsoft (R) .NET Framework Assembly Registration Utility 4.0.30319.1
Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.

Assembly exported to 'C:\WINDOWS\system32\MySql.Data.tlb', and the type library was registered successfully
----------

Can anyone advise on why the %computername% only appears on the first computer it is run on and not the rest?

share|improve this question
    
Are multiple computers logging to the same log file? Maybe the name is logged, but in between the logs of another computer? –  Werner Henze Jun 4 '13 at 13:47
    
This batch file is pushed out to multiple computers using PDQ, so each computer will log to the same file. I could have logged to separate files i.e one log per computer, but this defeats the point of looking through one log file to scan for any errors. –  ghost3h Jun 4 '13 at 14:11
    
What if logging from one computer locks the file so another computer cannot log his message? Maybe this is happening here. –  Werner Henze Jun 4 '13 at 14:17
    
If that's the case why would it Only leave out the %computername% and log the rest. I'm stuck :( –  ghost3h Jun 4 '13 at 15:24
    
It is not very propable, but possible. And if output redirection does not lock the log file at all, then you could even end up with one logger overwriting the log of another logger. You could extend your log to "name=%computername%", so you can see if only the variable is empty or if the echo gets lost. –  Werner Henze Jun 5 '13 at 8:05
show 2 more comments

1 Answer

Thanks for the help guys , I have it working now. I simply have the batch file save the information locally on each machine first instead of logging it straight to the server, I can then use the TYPE command to append the info to my server share.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe /codebase /tlb "Agent.dll" >> c:\agent_logs.log


Type c:\agent_logs.log >> "\\servershare\software\Admin\IT_Support_Utilities\PDQ Deployment\agent_logs.log"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.