<PAGE>   1


                                                                   EXHIBIT 10.4


                               EXECUTIVE AGREEMENT

        Executive Agreement made as of this 1st day of July 1998, by and between
Hadco Corporation, a Massachusetts corporation with a principal place of
business at 12A Manor Parkway, Salem, New Hampshire 03079 (the "Company") and
TIMOTHY P. LOSIK, an individual residing at 525 SOUTH ROAD, RYE, NEW HAMPSHIRE
(the "Executive").

        WHEREAS, the Company desires to employ the Executive upon the terms and
conditions hereinafter set forth; and

        WHEREAS, the Executive desires to be employed upon the terms and
conditions hereinafter set forth.

        NOW, THEREFORE, in consideration of the premises and for other good and
valuable consideration, the receipt and legal sufficiency of which are hereby
acknowledged, the parties hereto agree as follows:

        1. EMPLOYMENT. The Company agrees to employ the Executive on a full-time
basis, subject to the terms and conditions set forth herein, and the Executive
agrees to accept such full time employment upon said terms and conditions. The
Executive's employment shall be subject to the standard terms and conditions and
policies applicable to all employees of the Company, as such terms and policies
may exist from time to time.

        2. TERM. The term of employment under this Agreement ("the Term") shall
commence on the date hereof and shall continue for an indefinite term, subject
to mutual agreement between the Executive and the Company.

        3. DUTIES. The Executive shall serve the Company in such senior
executive capacity or capacities, and with such duties, as shall be designated
by the Company from time to time, subject to and under the supervision of the
Company's Board of Directors.

        4. COMPENSATION. The Company shall pay the Executive a Base Salary at
the same rate as currently paid such Executive, provided that such rate may be
increased from time to time by the Company in its discretion. The Executive
shall be accorded such benefits as are customarily enjoyed by executives of the
Company, and shall be entitled to participate in any executive incentive
compensation or bonus plan approved by the Board of Directors or the
Compensation Committee thereof. The Company may, from time to time, in its
discretion, grant stock options or other equity compensation to the Executive.

        5. NON-COMPETITION; NON-SOLICITATION.

        a. NON-COMPETE. The Executive acknowledges that he/she has gained or
will gain extensive and valuable experience and knowledge in the business
conducted by the Company and has had or will have extensive contacts with the
customers, suppliers, investors, and/or consultants of the Company. The
Executive recognizes that it is critical to the ongoing success 



                                       1


<PAGE>   2

of the Company that it preserve its goodwill and protect its proprietary rights
and its other important business interests.

        Accordingly, the Executive agrees that he/she will not, while employed
by the Company during the Term hereof and for a period of one year thereafter
(or, in the event of the Company's termination of the Executive without cause or
if the Executive's employment is terminated by him/her for Good Reason (as
defined herein) or by the Company within six months before or within twenty-four
(24) months after a Change of Control (as defined herein), for such longer
period during which the Executive is receiving compensation pursuant to the
provisions of Section 8 hereof), directly or indirectly, engage in (whether as
an officer, employee, consultant, director, proprietor, agent, partner or
otherwise) or have an ownership interest in, or participate in the financing,
operation, management or control of, any person, firm, corporation or business
engaged in competition with the Company, any of its affiliates, its parent or
subsidiaries in the business of manufacture or sale of printed circuit boards,
backpanels, backplanes and/or box build assembly products, or in the development
of technology for such businesses; provided, however, that these restrictions
shall only apply to the Executive's activities post-termination of employment
with persons, firms, corporations or businesses with annual gross revenues in a
competing business, as defined herein, (in the aggregate with its affiliated
entities) in excess of one hundred million United States dollars. It is agreed
that ownership of no more than 4.9% of the outstanding voting stock of a
publicly traded corporation shall not constitute a violation of this provision.
In recognition of the fact that the Company's business is global, the territory
to which the restrictions contained in this Section 5(a) shall apply shall be
worldwide.

        The Company may waive the foregoing restrictions or their application in
any particular circumstance and may condition any such waiver upon receipt of
assurances satisfactory to the Company, from the Executive and/or others, that
the Executive's proposed activity will not adversely affect the Company's
goodwill, proprietary rights or other important business interests.

        b. NON-SOLICITATION. While actively employed by the Company during the
Term hereof and for a period of one year thereafter (or, in the event of the
Company's termination of the Executive without cause or if the Executive's
employment is terminated by him/her for Good Reason (as defined herein) or by
the Company within six (6) months before or within twenty-four (24) months after
a Change of Control (as defined herein), for such longer period during which the
Executive is receiving compensation pursuant to the provisions of Section 8
hereof), the Executive agrees that he/she shall not solicit any persons or
companies who were customers, suppliers or business patronage of the Company or
its affiliates, parent or subsidiaries during the Term or prior thereto, if such
solicitation is for the purpose of, or results in, competition with the Company,
any of its affiliates, its parent or subsidiaries; nor will he/she solicit for
any purpose the employment of any employees of the Company, any of its
affiliates, its parent or subsidiaries while actively employed by the Company
during the Term hereof and for a period of one year thereafter.

        c. CONFIDENTIAL INFORMATION. The Executive acknowledges that he/she may
receive, or contribute to the production of, Confidential Information. For
purposes of this Agreement, the Executive agrees that "Confidential Information"
shall mean information or material proprietary to the Company, its affiliates,
its parent, or any of its direct or indirect subsidiaries, or designated 


                                       2



<PAGE>   3

as Confidential Information by such entities and not generally known by
personnel not employed by or affiliated with one or more of such entities, which
the Executive develops or of or to which the Executive may obtain knowledge or
access through or as a result of the relationship with the Company, its
affiliates, its parent or any of its direct or indirect subsidiaries (including
information conceived, originated, discovered or developed in whole or in part
by the Executive). Confidential Information also includes but is not limited to,
the following types of information and other information of a similar nature
(whether or not reduced to writing) related to the Company's business, or that
of its affiliates, its parent or any of its direct or indirect subsidiaries:
discoveries, inventions, ideas, concepts, research, development, processes,
procedures, "know-how", formulae, marketing techniques and materials, marketing
and development plans, business methods of operation, financial information,
employee compensation, and computer programs and systems. Confidential
Information also includes any information described above which the Company, its
affiliates, its parent, or any of its direct or indirect subsidiaries obtained
from another party and which the Company, its affiliates, its parent, or any of
its direct and indirect subsidiaries treats as proprietary or confidential, or
designates as Confidential Information, whether or not owned by or developed by
the Company, its affiliates, its parent, or any of its direct or indirect
subsidiaries. The Executive acknowledges that the Confidential Information
derives independent economic value, actual or potential, from not being
generally known to, and not being readily accessible by proper means by, other
persons who can obtain economic value from its disclosure or use. Information
publicly known without breach of this Agreement that is generally employed by
the trade at or after the time the Executive first learns of such information,
or generic information or knowledge which the Executive would have learned in
the course of similar employment or work elsewhere in the trade, shall not be
deemed part of the Confidential Information. The Executive further agrees:

        (1) To furnish the Company on demand, and at any time during or within
one year after termination of employment, a complete list of the names and
addresses of all present, former and potential suppliers, customers and other
contacts gained while an Executive of the Company in the Executive's possession,
whether or not in the possession or within the knowledge of the Company.

        (2) That all notes, memoranda, electronic storage, documentation and
records in any way incorporating or reflecting any Confidential Information
shall belong exclusively to the Company, and the Executive agrees to turn over
all copies of such materials in the Executive's control to the Company upon
request and upon termination of the Executive's employment with the Company.

        (3) That while employed by the Company and indefinitely after
termination of employment for any reason, the Executive will hold in confidence
and not directly or indirectly reveal, report, publish, disclose or transfer any
of the Confidential Information to any person or entity, or utilize any of the
Confidential Information for any purpose, except in the course of the
Executive's work for the Company.

        (4) That any idea in whole or in part conceived of or made by the
Executive during the Term of his/her employment with the Company which relates
directly or indirectly to the Company's current or planned line of business and
is made through the use of any of the Confidential Information or any of the
Company's equipment, facilities, trade secrets or time, or which results from
any work performed by the Executive for the Company, shall belong exclusively to
the Company and shall be deemed a part of the Confidential Information for
purposes of this Agreement. The Executive hereby assigns and agrees to assign to
the Company 



                                       3


<PAGE>   4

all rights in and to such Confidential Information whether for purposes of
obtaining patent or copyright protection or otherwise. The Executive shall
acknowledge and deliver to the Company, without charge to the Company (but at
its expense) such written instruments and do such other acts, including giving
testimony in support of the Executive's authorship or inventorship, as the case
may be, necessary in the opinion of the Company to obtain patents or copyrights
or to otherwise protect or vest in the Company the entire right and title in and
to the Confidential Information. If disclosure of any Confidential Information
is requested or required by judicial or governmental order, the Executive shall
promptly notify the Company of receipt of the judicial or governmental order and
shall take reasonable steps to assist the Company in contesting such order
and/or in protecting the Company's rights prior to disclosure.

        d. INJUNCTIONS. It is agreed that the restrictions contained in this
Section 5 are reasonable, but it is recognized that damages in the event of the
breach of any of the restrictions will be difficult or impossible to ascertain;
and, therefore, the Executive agrees that, in addition to, and without limiting
any other right or remedy the Company may have, the Company shall have the right
to an injunction against the Executive issued by a court of competent
jurisdiction enjoining any such breach.

        e. PART OF CONSIDERATION. The Executive also agrees, acknowledges,
covenants, represents and warrants that he/she is fully and completely aware
that, and further understands that, the foregoing restrictive covenants are an
essential part of the consideration for the Company entering into this Agreement
and that the Company is entering into this Agreement in full reliance on these
acknowledgments, covenants, representations and warranties.

        f. TIME AND TERRITORY REDUCTION. If the period of time or territory
described above are held to be in any respect an unreasonable restriction, it is
agreed that the court so holding may reduce the territory to which the
restriction pertains or the period of time in which it operates or may reduce
both such territory and such period, to the minimum extent necessary to render
such provision enforceable.

        g. SURVIVAL. The obligations described in this Section 5 shall survive
any termination of this Agreement, or any termination of the employment
relationship created hereunder.

        6. TERMINATION. Notwithstanding any other provision of this Agreement,
the Company shall have the right to terminate the Executive's employment, with
or without cause, at any time. For purposes of this Agreement, the Company shall
have "cause" to terminate the Executive in the event of: (a) the willful and
continued failure by the Executive to substantially perform his/her duties,
after demand for substantial performance is delivered by the Company to the
Executive identifying with specificity the grounds for the Company's' belief
that the Executive has not substantially performed his/her duties; (b) the
permanent physical or mental incapacity of the Executive; (c) the commission by
the Executive of any act of fraud or embezzlement relating to the property of
the Company and/or the services to be provided by the Executive; or (d) the
Executive's unauthorized disclosure or use of proprietary confidential
information of the Company or the Executive's engaging in competition with the
Company.



                                       4


<PAGE>   5

        7. CHANGE OF CONTROL. In the event the Executive's employment with the
Company is terminated by the Company within six (6) months prior to or within
twenty-four (24) months after a Change of Control (as defined herein) or in the
event the Executive terminates his/her employment for Good Reason (as defined
herein) within twenty-four (24) months after a Change of Control (as defined
herein), the Executive shall be treated as if his/her employment were terminated
by the Company without cause. Without limiting the generality of the foregoing,
in such circumstances, the Executive shall receive from the Company all
compensation described in Section 8 hereof, for the period of time and subject
to the limitations provided in such Section. Once the Executive becomes entitled
to receive benefits under this Section 7, then such benefits shall continue
until paid in full, subject to the terms and conditions stated herein,
notwithstanding the Executive's subsequent death, in which case payments shall
be made to the Executive's estate. A Change of Control, as used herein, shall
mean any sale of all or substantially all of the assets of the Company, or any
merger, consolidation or tender offer in respect of which the stockholders
holding all of the Company's outstanding voting securities immediately prior to
the consummation thereof hold less than 50% of all of the Company's outstanding
voting securities immediately after such consummation. The Executive shall have
Good Reason to terminate his/her employment with the Company within twenty-four
(24) months after a Change of Control if, without his/her prior written consent,
he/she suffers (a) any significant diminution in position, duties,
responsibilities, authority, title or office as in effect immediately prior to
the Change of Control; (b) any reduction in his/her Base Salary as in effect on
the date hereof or as the same may be increased prior to the Change of Control;
(c) the failure by the Company to continue in effect, at a coverage or benefit
level of at least 90% of that in effect immediately prior to the Change of
Control of the Company, any benefit or compensation plan; (d) any requirement by
the Company that the Executive perform his/her principal duties for the Company
at a location more than 30 miles radius from the location at which the Executive
performed such duties immediately prior to the Change in Control; or (e) any
requirement by the Company that the Executive engage in business travel to a
significantly greater extent than immediately prior to the Change of Control;
provided, however, that the Executive shall not be entitled to benefits under
this provision unless he/she gives notice to the Company within 180 days of when
the Executive first becomes aware of such diminution, reduction, failure, or
requirement, as the case may be.

        8. THE COMPANY'S OBLIGATIONS AFTER TERMINATION. In the event of the
Company's termination of the Executive's employment without cause, or in the
event of the Executive's termination of his/her employment for Good Reason (as
defined herein) or by the Company within six months before or within twenty-four
(24) months after a Change of Control (as defined herein), and so long as the
Executive has not breached any obligation of the Executive under Section 5
hereof, the Company shall continue to pay to the Executive and provide for the
benefit of the Executive certain items of compensation, as set forth below, for
a period equal to one (1) year plus one (1) month for each full year of
consecutive service completed by the Executive prior to the date of termination
(including service prior to the date of execution of this Agreement); provided,
however, that the Executive shall be entitled to a maximum of twenty-four (24)
months of compensation. Once the Executive becomes entitled to receive benefits
under this Section 8, then such benefits shall continue until paid in full,
subject to the terms and conditions stated herein, notwithstanding the
Executive's subsequent death, in which case payments shall be made to the
Executive's estate. For purposes of this Agreement, the Executive's starting
date of service to the Company is November 24, 1986.



                                       5



<PAGE>   6

        The compensation to be provided to the Executive pursuant to the terms
of this Section are as follows:

            (a) Base salary at the rate in effect as of the date of termination;
            (b) Health insurance, life insurance, disability insurance and
                reimbursement of the cost of tax or financial planning 
                assistance up to a maximum of $1200 per year; and
            (c) Outplacement services.

        In addition, the Executive shall be paid (i) a pro-rated incentive
amount based on the portion of the then current fiscal year completed at the
time of termination compared to the Executive's expected incentive compensation
for such year at the target level of such incentive compensation program for the
Executive, and (ii) all deferred compensation then maintained in the Executive's
account, including without limitation all restricted stock, all in accordance
with the options for payment which may then be available for payment of such
deferred compensation to eligible employees. The payments described in clauses
(i) and (ii) of this Section 8 shall be paid promptly after termination of
employment. The payments to be made by the Company to the Executive pursuant to
the provisions of paragraph (a) of this Section 8 shall be made on whatever the
then customary payment schedule is for compensation of executive employees of
the Company (i.e. monthly, bi-weekly, or the like). However, the payments under
paragraphs (a) and (b) shall be not be considered employee compensation or be
subject to tax withholding by the Company; rather they shall be made in exchange
for the Executive's covenant not to compete, as set forth in Section 5(a)
hereof. If, at any time, the payments made under paragraphs (a) and (b) are
determined by any state or federal taxing authority to be employee compensation,
then the Company agrees to pay its share of FICA and Medicare tax on such
payments, plus any interest or penalty that may be due as a result of the taxing
authority's determination and that relates to the Company's unpaid tax. In the
event the Executive secures a new employment position during the period of the
Company's continuing payment of compensation to him/her, the Executive shall
promptly notify the Company of the commencement of the new employment position
and shall inform the Company of the extent to which benefits to be provided by
the Company hereunder are duplicative of benefits then available to the
Executive through his/her new employment position. To the extent that the
benefits to be provided by the Company hereunder are duplicative, the Company
shall be entitled to cease provision of such benefits. Nothing contained herein
shall, however, be construed as reducing the obligation of the Company to
continue to make Base Salary payments or to pay the incentive compensation and
deferred compensation amounts due to the Executive as provided herein.

        If the payments provided for in this Agreement, together with any other
payments or benefits which the Executive has the right to receive from the
Company (or its affiliates, its parent or subsidiaries), would constitute an
"excess parachute payment" (as defined in Section 280G of the Internal Revenue
Code), the Executive shall receive either: (x) all compensation and benefits
provided for him or her under this Agreement, or (y) the maximum of compensation
and benefits that will avoid an excess parachute payment under Section 280G;
whichever would provide the greater after-tax benefit to the Executive. In the
event that clause (y) provides the greater after-tax benefit, the Executive
shall be entitled to select the items to be abated. If the 



                                       6


<PAGE>   7

Executive is to receive the clause (y) benefits and through error or otherwise
the Executive receives payments, together with other payments the Executive has
the right to receive from the Company (or its affiliates, its parents or
subsidiaries) in excess of 2.99 times the Executive's base amount, the Executive
agrees to immediately repay the excess to the Company upon notification that an
overpayment has been made. If the Company has previously issued a W-2 statement
to the Executive and the taxing authorities with respect to these payments
and/or withheld taxes from the Executive based on these payments, then the
Company agrees to promptly issue a corrected W-2 to the Executive and the taxing
authorities and/or to refund the excess withheld taxes to the Executive, as the
case may be.

        9. FUNDING OF COMPANY'S OBLIGATIONS. In the event of a Change of
Control, the Company agrees, prior to consummation of the transaction
constituting the Change of Control, to create a so-called Rabbi Trust and to
fund said Rabbi Trust with an amount equal to all amounts which may become due
to the Executive under this Agreement as a result of the Change of Control.
Without limiting the generality of the foregoing, the funding shall include all
amounts which may become due to the Executive in the event of his/her subsequent
termination of employment within twenty-four (24) months of the Change of
Control, including without limitation, all deferred compensation amounts then
deferred for the Executive.

        10. GOVERNING LAW AND VENUE. This Agreement shall be construed and
enforced in accordance with the substantive law of the Commonwealth of
Massachusetts, without giving effect to its conflicts of law principles. The
parties agree that any litigation pertaining to this Agreement shall be
maintained exclusively in the courts of general jurisdiction located in
Massachusetts, and each party agrees to submit to the jurisdiction and venue of
any such court. Notwithstanding the foregoing, the Company shall be entitled to
file litigation against the Executive in any jurisdiction where the Company
deems it necessary or advisable to do so in order to enforce the provisions of
Section 5 hereof.

        11. CONSTRUCTION. The language in all parts of the Agreement shall in
all cases be construed as a whole according to its fair meaning and not strictly
for or against either party. The section headings contained in this Agreement
are for reference purposes only and will not affect in any way the meaning or
interpretation of this Agreement. All terms used in one number or gender shall
be construed to include any other number or gender as the context may require.
The parties agree that each party has reviewed this Agreement and has had the
opportunity to have counsel review the same and that any rule of construction to
the effect that ambiguities are to be resolved against the drafting party shall
not apply to the interpretation of this Agreement or any amendment thereof.

        12. NONDELEGABILITY OF THE EXECUTIVE'S RIGHTS AND ASSIGNMENT RIGHTS OF
THE COMPANY. The obligations, rights and benefits of the Executive hereunder are
personal and may not be delegated, assigned or transferred in any manner
whatsoever, nor are such obligations, rights or benefits subject to involuntary
alienation, assignment or transfer. This Agreement may be assigned by the
Company to its parent or any subsidiary or affiliate, and shall be assigned
automatically to any entity merging with or acquiring the Company or its parent
or business of the Company. Without limiting the generality of the foregoing,
the Company agrees to require any purchaser of all or substantially all its
assets to agree to perform the Company's obligations under this Agreement. 



                                       7


<PAGE>   8

Any successor to the Company, whether by assignment or otherwise, shall be
considered the Company for purposes of this Agreement.

        13. SEVERABILITY. If any term or provision of this Agreement is declared
by a court of competent jurisdiction to be invalid or unenforceable for any
reason, this Agreement shall remain in full force and effect, and the parties
will request the court to (a) modify the invalid or unenforceable provision to
the minimum extent necessary to make it valid and enforceable, or (b) if the
court determines that such a modification is not possible, interpret this
Agreement as if such invalid or unenforceable provisions were not a part hereof.

        14. NOTICES. All notices required or permitted hereunder shall be in
writing and shall be deemed duly given, upon receipt, if either personally
delivered, sent by certified mail, return receipt requested, or sent by a
nationally recognized overnight courier service, addressed to the parties as
follows:

If to the Company:   Hadco Corporation
                     12A Manor Parkway
                     Salem, NH 03079
                     Attn: General Counsel

With a copy to:      Hamilton & Dahmen, LLP
                     73 Tremont Street
                     Boston, MA 02108

If to the Executive: Timothy P. Losik
                     525 South Road
                     Rye, NH 03870

or to such other addresses either party may provide to the other in accordance
with this Section.

        15. ENTIRE AGREEMENT. This Agreement constitutes the entire agreement
between the parties with respect to the subject matter hereof (i.e. the
Executive's employment by the Company) and supercedes all prior or
contemporaneous employment agreements and understandings or agreements in regard
to the Executive's employment. No modification or addition to this Agreement
shall be valid unless in writing, specifically referring to this Agreement and
signed by both parties hereto. No waiver of any rights under this Agreement
shall be valid unless in writing and signed by the party to be charged with such
waiver. No waiver of any term or condition contained in this Agreement shall be
deemed or construed as a further or continuing waiver of such term or condition,
unless the waiver specifically provides otherwise.






                                       8

<PAGE>   9


        IN WITNESS WHEREOF, the parties have set their hands as the day and year
first above written.

                                             HADCO Corporation



----------------------------                 -------------------------------
Witness                                      Its
                                             Duly Authorized



                                             Executive




-----------------------------                -------------------------------
Witness                                      Timothy P. Losik




                                       9