conjunction, auxiliary
Archaic or highly literary conjunction/auxiliary that attaches to the imperfective form (未然形) of verbs and adjectives. Equivalent to modern ないで or ずに, but now mostly found in classical texts, proverbs, or formal set phrases.
See also: ないで
「思わずして」は、古い言い方で「思わないで」という意味です。
「思わずして」 is an old expression meaning 'without thinking' or 'unintentionally'.
古典では「知らずして」のように使われることがあります。
In classical Japanese, it can be used like 「知らずして」 (without knowing).