<PAGE>
                                                                    Exhibit 10.4
================================================================================
FOURTH AMENDMENT TO
AMENDED AND RESTATED LOAN AND SECURITY AGREEMENT
165336.1
================================================================================

                                             Dated and Effective August 16, 1996

     THIS FOURTH AMENDMENT IS made to the Amended and Restated Loan and Security
Agreement (the "Loan Agreement"), which Amended and Restated Loan and Security
Agreement took effect on April 6, 1995 as an amendment and restatement of the
December 16, 1994 Loan and Security Agreement made between

           The First National Bank of Boston, a national banking association
     with offices at 100 Federal Street, Boston, Massachusetts, as agent for the
     ratable benefit of the "Lenders" being:

               The First National Bank of Boston;

                      and

               State Street Bank and Trust Company, a Massachusetts trust
           company with offices at 225 Franklin Street, Boston, Massachusetts
           02110;

                      and

               Citizens Bank of Massachusetts, a Massachusetts savings bank with
           offices at 55 Summer Street, Boston, Massachusetts 02110


           and

           ACT Manufacturing, Inc., a Massachusetts corporation with its
     principal executive offices at 108 Forest Avenue, Hudson, Massachusetts
     01749

in consideration of the mutual covenants contained herein and benefits to be
derived herefrom,



<PAGE>
 
                                  WITNESSETH:

     1.   AGREEMENT TO AMEND
          ------------------
 
     Provided each of those "Conditions to Amendment" set forth in Section 2,
below, is satisfied on or before September 13, 1996, the Loan Agreement shall be
amended, as set forth below, such amendment to take effect as of August 16,
1996.

     EXHIBIT 9-11 (Total Debt to Net Worth Requirement) of the Loan Agreement 
          is amended to read as follows:

          2.   Total Debt to Net Worth:  The Borrower shall not permit the ratio
of its Total Debt to Net Worth to exceed the following on the date indicated:
<TABLE>
<CAPTION>
======================================================  
Date                            Maximum Ratio:
                                Total Debt / Net 
                                Worth
======================================================  
<S>                             <C>
December 31, 1994                                 3.75
======================================================  
Immediately after IPO                             1.20
------------------------------------------------------
June 30, 1996 and thereafter                      1.60
======================================================  
 
</TABLE>

          2.    CONDITIONS TO EFFECTIVENESS OF AMENDMENT
                ---------------------------------------- 

          The within Amendment shall be effective if each of the following
conditions is   satisfied on or before September 13, 1996 and on the date on
which such amendment   is to take effect, no Suspension Event (as defined in the
Loan Agreement) is extant:
 
                (a)   Receipt by the Agent of a Certificate setting forth the
text of the resolutions adopted by the Directors of the Borrower authoritizing
the Borrower's execution of the within Amendment, and attesting to the authority
of the persons who executed the within Amendment on behalf of the Borrower.
 
                (b)   Receipt by the Agent of a Certificate, executed by the
Borrower's President and its Chief Financial Officer, respectively confirming
that no Suspension Event is then extant. 

<PAGE>
 
                (c)   Receipt by the Agent of an opinion of counsel to the
Borrower as to the due execution and effectiveness of the within Amendment
(which opinion is subject only to the same qualifications as had been included
in the opinion delivered by that counsel at the initial execution of the Loan
Agreement).                             
 
        The Borrower hereby represents that, at the execution of the within
Agreement, no Suspension Event has occurred.
 
        Except as amended hereby, or by the First or the Second Amendment to the
Loan Agreement, all terms and conditions of the Loan Agreement shall remain in
full force and effect.
 


                                ACT MANUFACTURING, INC.
                                              (The "Borrower")

                                By /s/ Douglass C. Greenlaw
                                  --------------------------------

                                Its Chief Financial Officer
                                   -------------------------------


THE FIRST NATIONAL BANK OF BOSTON
                    ("Agent")

By /s/ George Mandt
  --------------------------------

Its Vice President
   -------------------------------

                                 The "Lenders"

THE FIRST NATIONAL BANK OF BOSTON        STATE STREET BANK AND 
                                               TRUST COMPANY 

By  /s/ George Mandt                     By /s/ F. Andrew Beise
  --------------------------------         --------------------------------

Its Vice President                       Its Vice President
   -------------------------------          -------------------------------

CITIZENS BANK OF MASSACHUSETTS

By /s/ Kathryn Bacastow
  -------------------------------- 

Its Senior Vice President
   -------------------------------