[windows] anyone extremely familiar with net use?

Diablo Escobar

Contributor
Veteran XX
I'm working on a script to leverage net use to map some network drives in the background for some software...details aren't important

but i'm having a bitch of a time with the net use command and understanding its persistence, anyone familiar here or am I wasting my time?

In particular, without the PERSIST=Y set, how long will the map last?

Also, i'm getting a ton of user/pass errors on a drive the user i'm logged in as definitely has access to, what could be causing this?
 
you cannot map a drive with different credentials than you are currently logged in as

I'm not sure the exactly the duration of the persistence, but its not uncommon on windows rigs for it to forget credentials for mapped drives somewhat frequently.
 
Last edited:
gayest-connery-pic-ever.jpg
 
Persistent should keep the drive mapped until you delete it.

As far as user/pass problems, try to specify the user using /user:<username> <password> to specify the user/pass explicitly and see if that helps. If it doesn't, I'm at a loss :shrug:
 
my next step will be to try to explicitly define user pass using /user, but that's really not a palatable solution, since it will expose the password in plaintext in my script

as far as different credentials, i'm trying to map it as the same user i'm logged in as...i can \\ to the drive, and I can map it from a cmd prompt, but in the script i get the permissions error
 
as far as different credentials, i'm trying to map it as the same user i'm logged in as...i can \\ to the drive, and I can map it from a cmd prompt, but in the script i get the permissions error
Is the script running in the SYSTEM user context?
 
Back
Top