C# - using getcompenent

Hello,

I have been trying to search for this, but i cannot seem to find it anywhere. Is it possible to active and disable a script on a GameObject from another GameObject?

Object A: Contains ScriptA

Object B: Contains ScriptB that deactivates script A when loaded.

I was thinking something like (from ScriptB):

 public GameObject GameObjectA;  

 Void Start () {
 GameObjectA.GetComponent(ScriptA).enabled = false;

}

Similar, use this:

public GameObject GameObjectA;

private void Start(){
	GameObjectA.GetComponent<ScriptA>().enabled = false;
}

Or consider doing this:

public ScriptA script;

private void Start(){
	script.enabled = false;
}