Page 1 of 1 1
Topic Options
#20389 - 2002-04-23 12:36 AM home dir? homeshr? declare a variable??? yikes!
scsigrrrl99 Offline
Fresh Scripter

Registered: 2002-04-22
Posts: 13
Loc: florida
Trying to get the H: drive to map to the user's home directory.

The home directory name is the same as the logon name.

The home directory has been shared, and just that one user has rights to it (besides domain admins).

The share name of the home directory is the same as the user's logon name, also.

I have:

use H: /delete /yes
use H: @HOMESHR

as you know, this won't work. I am realizing that I am going to have to define/declare a variable, I think. Yes?

thanks,
scsigrrrl99

Top
#20390 - 2002-04-23 12:55 AM Re: home dir? homeshr? declare a variable??? yikes!
scsigrrrl99 Offline
Fresh Scripter

Registered: 2002-04-22
Posts: 13
Loc: florida
I just found this (from Member #288)

posted 27 November 1999 06:43:

IF INGROUP ("YourGroup")
$drive="\\server\"+@userid+chr(36)
USE H: $drive

(...but what is that "+chr(36)" part?)

I tried:

use H: /delete /yes
$drive="\\server"+@userid

but it does NOT like that "@userid" part...

I know this is frustrating for you to hear all the time. I did a search of the archives...so far, not much has helped.

Still hoping and trying,
scsigrrrl99

Top
#20391 - 2002-04-23 01:16 AM Re: home dir? homeshr? declare a variable??? yikes!
scsigrrrl99 Offline
Fresh Scripter

Registered: 2002-04-22
Posts: 13
Loc: florida
I keep seeing this one pop up in the archives:

$drive="\\server\"+@userid+chr(36)

so I used that exactly, like so:

use H: /delete /yes
$drive="\\server"+@userid+chr(36)

and I get this result:

C:\logon scripts>kix32 test1
Script error : error in USE statement
$drive="\\server"+@userid+chr(36)

still trying, still hoping help will arrive...

Top
#20392 - 2002-04-23 01:26 AM Re: home dir? homeshr? declare a variable??? yikes!
scsigrrrl99 Offline
Fresh Scripter

Registered: 2002-04-22
Posts: 13
Loc: florida
I FOUND IT!!! I FOUND IT!!!

The problem was that darn "Use H: /delete" statement. When I removed it, and just used:

$drive="\\server"+@userid+chr(36)
use H: $drive

it worked like a charm!!! Wahooooo!!!

Thanks everybody. Bye!

Top
#20393 - 2002-04-23 04:45 AM Re: home dir? homeshr? declare a variable??? yikes!
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Glad we could be of some help.

BTW, the +chr(36) concatenation is nothing more than a $ (dollar sign) to denote a hidden share.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#20394 - 2002-04-23 05:00 AM Re: home dir? homeshr? declare a variable??? yikes!
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I trust the missing hack "\" between the server name and @UserID is present in your working code.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#20395 - 2002-04-23 05:50 AM Re: home dir? homeshr? declare a variable??? yikes!
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Welcome to the board.

The problem you starting with doesn't have a relation with USE H: /delete part,
but the additional parameter /yes was wrong.
For deleting a specific drive mapping you may use

USE H: /delete
or
USE H: /delete /persistent

And we agree with LLigetfa that you are missing the "\" character.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#20396 - 2002-04-23 03:11 PM Re: home dir? homeshr? declare a variable??? yikes!
scsigrrrl99 Offline
Fresh Scripter

Registered: 2002-04-22
Posts: 13
Loc: florida
Okay...now I'm using:

$drive="\\server"\+@userid+chr(36)
use H: $drive

and the result is only half-right, because there is no H: drive, however, it seems to make a connection to the user's home share (on a Win98 machine, after running the kix script, which now looks like this):

use "*" /delete

$drive="\\server"+\@userid
use H: $drive

as soon as you execute the script, the first command works fine, all drive mappings are delted, and then you see \\server\userid,
and then you're back at the prompt. When I do a "net use" command, it just shows the \\server\userid connection, but there is no drive letter for it. In short, my connection is mapping, but the H: drive is not there.

And I thought a good night's sleep would clear everything up!

Please reply. This wasn't supposed to drag into today...I was supposed to have it figured out last night!

scsigrrrl99

Top
#20397 - 2002-04-23 03:22 PM Re: home dir? homeshr? declare a variable??? yikes!
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
First, you have the hack in the wrong place.

$drive="\\server\"+@userid

Second, you don't say is the shares are hidden so cannot advise on the $.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#20398 - 2002-04-23 03:42 PM Re: home dir? homeshr? declare a variable??? yikes!
scsigrrrl99 Offline
Fresh Scripter

Registered: 2002-04-22
Posts: 13
Loc: florida
yes, sorry about that...I forgot to say that these shares are not hidden, so I am thinking I do not need the +chr(36) part.

how stupid of me...this is so elementary...you are so patient! I see that you have been doing this for quite a while. I see posts from over a year ago from you on this topic. Wow. Thank you for not abandoning the newbies! Thank you for staying in this forum.

Here is my new script (I'm trying to make it a little bit more sophisticated-looking):

use "*" /delete

$s1="\\server1\"
$s2="\\server2\"

$hdrive=$s1+@userid
$archives=$s2+@userid

use H: $hdrive

IF INGROUP(ARCHIVES)
use O: $archives

...and guess what??? it works!!! You are my hero! I thank you for pointing out my syntax error. Thank you for sticking with me on this. Just, well, Thank you for your help!!!! [Wink] [Embarrassed] [Cool] [Smile] [Smile] [Smile] [Smile]

scsigrrrl99

Top
#20399 - 2002-04-23 04:10 PM Re: home dir? homeshr? declare a variable??? yikes!
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
I still don't see why the @HOMESHR doesn't work. It works fine for me. Of course, I use:

code:
IF "@HOMESHR" <> "" USE I: @HOMESHR ENDIF

Of course, this checks to see if someone has a home folder before mapping it. Otherwise you will get an error if the @HOMESHR returns nothing.

The home share is usually at "\\SERVER\USERNAME", although this is not 100% consistent.

So, can someone tell me why the @HOMESHR might not work?

Brian

Top
#20400 - 2002-05-20 04:57 PM Re: home dir? homeshr? declare a variable??? yikes!
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

It is always very good to make your required settings (mostly the USE part)
bulletproof.

It is possible to using also available homedrv & homeshr values, which
values can be set by users profiles.

without settings the call can be: net use U: \\server\@userid$
code:
IF (len(@homedrv) <> 0) AND (len(@homeshr) <> 0)
USE @homedrv /delete
USE @homedrv "@homeshr"
ELSE
IF (len(@homeshr) <> 0)
USE U: /delete
USE U: "@homeshr"
ELSE
USE U: /delete
USE U: "\\server\@userid$$"
ENDIF
ENDIF

greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1808 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.072 seconds in which 0.034 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