angryscientist
(Fresh Scripter)
2005-06-21 08:29 PM
USE command

Well ive hit another block in my logon script, ive read and re-read the syntax for the use statement in the manual, but the example syntax doesnt seem to indicate how im doing what im doing wrong.

Code:

FUNCTION ADDDRIVES
; *** BEGIN ADDDRIVES SUBROUTINE ***
USE H: "\\filesvr\public" /PERSISTANT
if @error = 0
? "H Drive Mapped Successfully"
ELSE
? @serror
ENDIF
USE X: "\\filesvr\users" /PERSISTANT
if @error = 0
? "X Drive Mapped Successfully"
ELSE
? @serror
ENDIF
ENDFUNCTION



AllenAdministrator
(KiX Supporter)
2005-06-21 08:39 PM
Re: USE command

I haven't tested your code... but one thing looks wrong... you have persistant mispelled... should be persistent. ie ... /PERSISTENT

Les
(KiX Master)
2005-06-21 08:40 PM
Re: USE command

You could start by spelling persistent correctly. WHy would you even try to map them persistent when you map them on every logon anyway? You also have to delete persistent mappings before attempting to remap them.

angryscientist
(Fresh Scripter)
2005-06-21 09:43 PM
Re: USE command

well les, the kixtart manual doesnt indicate what you just mentioned, so how would i know that?

in any case, it was the misspelling that was halting the script, even though it was reporting an error on the subsequent line, not the line with the typo.


Sealeopard
(KiX Master)
2005-06-22 05:08 AM
Re: USE command

Maybe one assumes some common sense? What's the point of a PERSISTENT mapping if the mapping is being made on every login anyway?

LonkeroAdministrator
(KiX Master Guru)
2005-06-22 11:48 AM
Re: USE command

as my coadmin said, maybe there is no network on next logon and thus, the script won't run.
well, all of us know there would be no drive connection either but that didn't stop him.
quess he was more concerned users seeing the drive letters in their wksta's


angryscientist
(Fresh Scripter)
2005-06-22 05:03 PM
Re: USE command

what is the key to building a successful network? redundancy.

work in a datacenter sometime.


LonkeroAdministrator
(KiX Master Guru)
2005-06-22 05:19 PM
Re: USE command

eh?
what that has to do with persistent connections?


NTDOCAdministrator
(KiX Master)
2005-06-22 05:44 PM
Re: USE command

In general one would use the /persistent switch to map a drive one time, not every logon. If you want to map the drive every logon, then the use of the /persistent switch is not recommended. By using the /persistent switch, once the drive has been mapped it should no longer require being mapped again as the OS will automatically remap it for you.
 


angryscientist
(Fresh Scripter)
2005-06-22 07:33 PM
Re: USE command

lonkero: forget it, NTDOC, that makes sense, i took the switches out. that switch just isnt really documented in the manual, and it seemed like a good idea at the time.

NTDOCAdministrator
(KiX Master)
2005-06-22 08:00 PM
Re: USE command

Yeah, I suppose Ruud didn't feel that it required explanation as it sort of mimicks the NET USE which does have the switch as well.

For further information please take a look here.

Microsoft NET USE in XP
 

Quote:

/persistent:{yes | no} : Controls the use of persistent network connections. The default is the setting used last. Deviceless connections are not persistent. Yes saves all connections as they are made, and restores them at next logon. No does not save the connection being made or subsequent connections. Existing connections are restored at the next logon. Use /delete to remove persistent connections.




 


Les
(KiX Master)
2005-06-22 08:10 PM
Re: USE command

Ja, but Ruud's implementation is different. Unlike the NET command, USE also needs the /persistent switch on /delete too.