Page 1 of 1 1
Topic Options
#142102 - 2005-06-21 08:29 PM USE command
angryscientist Offline
Fresh Scripter

Registered: 2005-06-15
Posts: 18
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


Top
#142103 - 2005-06-21 08:39 PM Re: USE command
Allen Moderator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4303
Loc: USA
I haven't tested your code... but one thing looks wrong... you have persistant mispelled... should be persistent. ie ... /PERSISTENT
Top
#142104 - 2005-06-21 08:40 PM Re: USE command
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
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.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#142105 - 2005-06-21 09:43 PM Re: USE command
angryscientist Offline
Fresh Scripter

Registered: 2005-06-15
Posts: 18
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.

Top
#142106 - 2005-06-22 05:08 AM Re: USE command
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11161
Loc: Boston, MA, USA
Maybe one assumes some common sense? What's the point of a PERSISTENT mapping if the mapping is being made on every login anyway?
_________________________
There are two types of vessels, submarines and targets.

Top
#142107 - 2005-06-22 11:48 AM Re: USE command
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22298
Loc: OK
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
_________________________
!

download KiXnet

Top
#142108 - 2005-06-22 05:03 PM Re: USE command
angryscientist Offline
Fresh Scripter

Registered: 2005-06-15
Posts: 18
what is the key to building a successful network? redundancy.

work in a datacenter sometime.

Top
#142109 - 2005-06-22 05:19 PM Re: USE command
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22298
Loc: OK
eh?
what that has to do with persistent connections?
_________________________
!

download KiXnet

Top
#142110 - 2005-06-22 05:44 PM Re: USE command
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11548
Loc: CA
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.
 

Top
#142111 - 2005-06-22 07:33 PM Re: USE command
angryscientist Offline
Fresh Scripter

Registered: 2005-06-15
Posts: 18
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.
Top
#142112 - 2005-06-22 08:00 PM Re: USE command
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11548
Loc: CA
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.




 

Top
#142113 - 2005-06-22 08:10 PM Re: USE command
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Ja, but Ruud's implementation is different. Unlike the NET command, USE also needs the /persistent switch on /delete too.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Chris S., Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
2 registered (Allen, ShaneEP) and 158 anonymous users online.
Newest Members
Sjaak, Biybucket, Markus1961, Ian231, kixnewbie12
17480 Registered Users

Generated in 0.055 seconds in which 0.019 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org