Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-08-2005, 10:01 AM
kblaine kblaine is online now
Registered User
 
Join Date: 04-30-2004
Posts: 12
Angry PSEXEC to run .Bat File

I am trying to run a batch file on a particular server, but it only works 1/3 of the time.

Here is what my VB step is:
psexec %server_name% -u domain\username -p mypassword -i c:\WEB_inst.bat

Here is the error I get 2/3 of the time:
The process tried to write to a nonexistent pipe.
Connecting to server_name..Starting PsExec service on server_name Connecting with PsExec service on Server_name Starting C:\WEB_inst.bat on Server_name..
C:\WEB_inst.bat exited on Server_name with error code 1.
Process completed with exit code 1

The batch script that I run, places approximately 100 assemblies into the GAC. Here is the line that is used in the bat file, multilplied by 100:
C:\gacutil -i C:\na33.2003\Infragistics.UltraChart.Core.v3.dll

Do you know of an easier way to automate installing 100 assemblies into the gac? Why is my build only working 1/3 of the time, and getting "the process tried to write to a nonexisitent pipe" the rest of the time?

Thank you!
Reply With Quote
  #2  
Old 09-08-2005, 11:17 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Regarding the batch file problem, it seems that PsExec has trouble sending a batch file's output to the pipe VBP creates (not sure if the problem is with VBP or PsExec, but we'll look into it). You can work around the problem by either

1) configuring the step to read output from None

or

2) configuring the step to read output from A file (%server_name%\c$\output.txt) and redirecting the batch file's output to that file (psexec %server_name% -u domain\username -p mypassword -i cmd /c c:\WEB_inst.bat > c:\output.txt)

One way to automate installing a bunch of assemblies into the GAC would be to build a VBP project on the remote computer that uses a Process Files + GAC Install action. Another option would be to use a FOR loop in your batch file (type for /? at a Command Prompt to see the available syntax).
Reply With Quote
  #3  
Old 09-08-2005, 01:47 PM
kblaine kblaine is online now
Registered User
 
Join Date: 04-30-2004
Posts: 12
Perfect thank you! Setting the output to none helped, though it would be nice to see the output in my build log file. But works, so I am happy.

I am looking into the for loop on my batch file. Thank you for the quick response!!
Reply With Quote
  #4  
Old 09-08-2005, 03:15 PM
kblaine kblaine is online now
Registered User
 
Join Date: 04-30-2004
Posts: 12
I am trying the following, but GACUTIL always needs one argument, like an assembly name. Know how to get around this? It doesn't seem to like wildcard characters.


D:\>FOR %v IN (D:\*.dll) DO Gacutil /I

D:\>Gacutil /I

Microsoft (R) .NET Global Assembly Cache Utility. Version 1.0.2914.16
Copyright (C) Microsoft Corp. 1998-2001. All rights reserved.

Option -I takes 1 argument

D:\>
Reply With Quote
  #5  
Old 09-08-2005, 03:39 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
FOR %v IN (D:\*.dll) DO Gacutil /I %v
Reply With Quote
  #6  
Old 09-09-2005, 08:50 AM
kblaine kblaine is online now
Registered User
 
Join Date: 04-30-2004
Posts: 12
Dang.. thanks!

So I have it all working successfully!

FOR /R D:\Infragistics\ %v IN (*.dll) DO D:\Infragistics\Gacutil.exe /I %v

Though I am still having troubles with the output. If I output to a file, it doesn't get written there. If I put standard output, it only works 1/3 of the time.

Thank you for the quick assistance on this. If you find a fix for the output, please post.

cheers.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 06:07 PM.


Copyright © 1999-2023 Kinook Software, Inc.