#43889 - 2003-08-11 06:21 PM
Mapping does nothing
|
neilj
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
|
|
|
|
#43893 - 2003-08-11 07:06 PM
Re: Mapping does nothing
|
neilj
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
|
|
|
|
#43895 - 2003-08-12 11:11 AM
Re: Mapping does nothing
|
neilj
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
   
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
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
|
|
|
|
#43899 - 2003-08-12 01:13 PM
Re: Mapping does nothing
|
neilj
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
|
|
|
|
#43902 - 2003-08-12 02:09 PM
Re: Mapping does nothing
|
neilj
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
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
|
Top
|
|
|
|
#43904 - 2003-08-12 02:24 PM
Re: Mapping does nothing
|
Richard H.
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
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
|
|
|
|
#43906 - 2003-08-12 03:23 PM
Re: Mapping does nothing
|
neilj
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 633 anonymous users online.
|
|
|