At a command prompt (or in a batch file), type: NET USE LPTx: \\computername\sharename /PERSISTENT:YES .