Page 1 of 1 1
Topic Options
#43889 - 2003-08-11 06:21 PM Mapping does nothing
neilj Offline
Fresh Scripter

Registered: 2003-08-08
Posts: 13
I now have a script as follows:

$fullname=split(@FULLNAME,' ')
$FirstDotLast=$fullname[0]+'.'+$fullname[ubound($fullname)]
MessageBox("First Last " + $FirstDotLast + ".", "Company name" - Logon Message",32,10)
use g: \\server01\hidden$$ /user:domain\+$FirstDotLast

The $firstdotlast is because we are connecting to another domain with a different naming structure. It all works, and displays the correct first.last name, but the mapping does nothing. Give it is hidden I have added the extra $, but how can I tell what is stopping it?

I tried the get command to enter password at a prompt, to include in the map command, but surely this would not be required.

Thanks

NJ

Top
#43890 - 2003-08-11 06:25 PM Re: Mapping does nothing
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You're missing the quotes.
use g: '\\server01\hidden$$ /user:domain\'+$FirstDotLast
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#43891 - 2003-08-11 06:26 PM Re: Mapping does nothing
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
code:
? 'Error '+@ERROR+' - '+@SERROR

will display the error code. You will also need to put the UNC in quotes and most likely provide the password for the alternate userid.
_________________________
There are two types of vessels, submarines and targets.

Top
#43892 - 2003-08-11 06:49 PM Re: Mapping does nothing
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
shouldn't it be like:
code:
use g: '\\server01\hidden$$' /user:'domain\'+$FirstDotLast

_________________________
!

download KiXnet

Top
#43893 - 2003-08-11 07:06 PM Re: Mapping does nothing
neilj Offline
Fresh Scripter

Registered: 2003-08-08
Posts: 13
Guys

I have tried all combinations, and at present using:

use g: '\\server\share$$' /user:'domain\'+$FirstDotLast

but I get nothing. No error and no prompt. UNC path OK and can connect and prompted for username details etc. Any other ideas?

I am assuming this is because I am connecting to a remote domain.

NJ

Top
#43894 - 2003-08-11 07:09 PM Re: Mapping does nothing
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Do
code:
debug on
use g: '\\server\share$$' /user:'domain\'+$FirstDotLast
? 'Error '+@ERROR+' - '+@SERROR
get $a

and let us know the error code
_________________________
There are two types of vessels, submarines and targets.

Top
#43895 - 2003-08-12 11:11 AM Re: Mapping does nothing
neilj Offline
Fresh Scripter

Registered: 2003-08-08
Posts: 13
Found that when using
use g: '\\server\share$$' /user:'domain\'+$FirstDotLast
that error suggested invalid username/password - although username was OK and password was never requested.

When adding password to string it worked OK.

Tried gets $password but this only seemed to work when in debug mode. When not in debug mode you don't get chance to type anything in? I know there is a sleep/wait command it still does not allow you to enter any password.

Any ideas?

NJ

Top
#43896 - 2003-08-12 11:34 AM Re: Mapping does nothing
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
The KiXtart "Use" is not the same as DOS "NET USE", so no, it won't pause and prompt for a password.

You must do the work yourself if you need a password.

Attempt the mapping, and if the error return indicates a security problem prompt for a login and password, and attempt the mapping again.

Here is some pseudo-code:
code:
Connect share
While @ERROR = "Wrong security credentials" AND NumberOfAttempts < 3
NumberOfAttempts=NumberOfAttempts+1
Prompt for Username
Prompt for Password
Connect share using username and password
Loop


Top
#43897 - 2003-08-12 11:56 AM Re: Mapping does nothing
neilj Offline
Fresh Scripter

Registered: 2003-08-08
Posts: 13
Can you shed light on the prompt for username and prompt for password?

I am using sget for $variable, but it does not appear to wait until you type in any details. It only accepts the details when in debug mode.

If I can prompt for password, I already have variable firstname.lastname, so it should map OK.

Thanks

NJ

Top
#43898 - 2003-08-13 12:09 AM Re: Mapping does nothing
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Do you use gets ?

If yes, it should work perfectly, never had any problems with it ...

Can you show us a snippet of your code ?
_________________________



Top
#43899 - 2003-08-12 01:13 PM Re: Mapping does nothing
neilj Offline
Fresh Scripter

Registered: 2003-08-08
Posts: 13
MessageBox("Enter password :" + ".", "Company xxx - Logon Message",32,10)
gets $password
use g: '\\server\share$$' /user:'domain\'+'first.last' /password:$password

At present I am just using first.last for testing. Once working I will replace with
$fullname=split(@FULLNAME,' ')
$FirstDotLast=$fullname[0]+'.'+$fullname[ubound($fullname)]

variable.

NJ

Top
#43900 - 2003-08-12 01:45 PM Re: Mapping does nothing
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
MessageBox() is (at least) application modal. While it is displayed input will not be accepted.

The input for "GetS" is taken from the console - you cannot use "GetS" in a console-less application (i.e. with wkix32).

If you want GUI input without a console you will need to use COM with either KixForms or Internet Explorer.

Top
#43901 - 2003-08-12 02:03 PM Re: Mapping does nothing
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Got a nice one from Shawn for ya (requires Excel installed)

Topic: XlsInputBox() - Displays a dialog box for user input (using excel)
_________________________



Top
#43902 - 2003-08-12 02:09 PM Re: Mapping does nothing
neilj Offline
Fresh Scripter

Registered: 2003-08-08
Posts: 13
So there is no way to map to a share on a remote network, where the password may change and cannot be part of a script? I don't have any com skills, but cannot believe i am the only person who ever needed to map a drive to a remote domain...?

I could map drives at the PC, with username, but this seems a really weak uncontrolable method to me...

Top
#43903 - 2003-08-12 02:21 PM Re: Mapping does nothing
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Nobody said that there is no way [Wink]

The only problem is to decide where the password should come from: every time at logon from the users or maybe better somewhere centrally in a file or better ini-file ?

Is that a per-user password or a global one ???

Btw, the function of Shwan does not require any com skills to implement, just read How to use UDFs and you're almost there [Wink]
_________________________



Top
#43904 - 2003-08-12 02:24 PM Re: Mapping does nothing
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
You can input the password without COM, but you must have an active console - I was assuming that as you had tried to use MessageBox() you wanted a GUI solution.

This example will simply prompt for and then display a password:
code:
"Enter your password: " GetS $sPassword
? "You entered: " $sPassword ?

There are two problems with this though.
1) The password is visible.
2) If the password is entered incorrectly there is no way to correct it.

You can solve the password display problem by using one the the user defined input functions from the UDF library. Use the search facility to search the UDF forum for "password" or "mask" and ignore any results which mention IP [Wink]

You can solve the incorrect password problem by using a loop like that which I used in the pseudo code in the earlier post.

Top
#43905 - 2003-08-12 03:05 PM Re: Mapping does nothing
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Youc an also use KiXforms to create a custom username/password dialog box that mimicks the standard Windows dialog boxes.

however, would it not be easier to establish some kind of trust between the two domains, thus allowing users in the one domain to use their own credentials to authenticate against the other domain?

I woudl not like any solution that stores an account password in a text file or other easily accessible location.
_________________________
There are two types of vessels, submarines and targets.

Top
#43906 - 2003-08-12 03:23 PM Re: Mapping does nothing
neilj Offline
Fresh Scripter

Registered: 2003-08-08
Posts: 13
Sorted!! Found line at start of .kix file with text "setconsole("hide") was preventing the display and prompts.

now get prompt, although preceeded by 000 (no debug on), but this is sorted by a quick cls for now.

Thanks for all your help guys.

NJ

Top
#43907 - 2003-08-12 03:26 PM Re: Mapping does nothing
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See the FAQ Forum under Why does the console display zeros and ones (amongst others)?
_________________________
There are two types of vessels, submarines and targets.

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 633 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.071 seconds in which 0.026 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