We use a bang-bang optimal control model to derive a rule of thumb for an optimal management of invasive weeds, in terms of the marginal benefits and costs of various control actions. Instead of determining the size of infestation under an optimal surveillance measure, the rule specifies the types of land where an invasive weed should be first prevented from establishment, and under what conditions control should be initiated. The types of land are modeled via the heterogeneous vulnerability of land to the weed and likely infestation. This easy-to-use rule is applied to determine how hawkweed should be controlled in Australia, across three potential control strategies: containment, eradication and no action. We investigate this rule-of-thumb in both deterministic and stochastic settings. With uncertainty, when calculating the threshold of when and how to act, we take into account the fact that delaying a control action will incur not only larger damage and a potentially larger spread but also a higher cost from uncertainty in the spread of the weed itself. The land value threshold is thus given by the unit cost of keeping a weed off a parcel of land times the difference between the interest rate and the current weed spread rate plus the effect of uncertainty. An application to hawkweed in Australia is provided. The rule specifies that hawkweed should be immediately eradicated in all types of agricultural lands they currently occupy where the potential damage is larger than 15AUD/ha/year. This generates a full eradication strategy under broad parameter values. Though the cost of removing hawkweeds is significant, it is overwhelmed by the damage if Hawkweeds spread to higher value agricultural land.