Confused here, I've never seen any reference to this in documents before...IMHO Kix v3.63 and before had a severe bug in the USE command surrounding parameters passed to it. I struggled to programmaticaly store username, password, share, server etc. in INI files and pull them out. E.g.
$INIFile is somewhere looking like this:
[SETTINGS]
Driveletter=V
Server=INSTALLSERV
Share=PACKAGES$
Username=JOEBLOGGS
Domain=NTDOMAIN
Password=letmein
Therefore a piece of code looking like this fails:
$DriveLetter=getprofilestring($INIFile, "Settings", "DriveLetter")
$Share=getprofilestring($INIFile, "Settings", "Share")
$Share=getprofilestring($INIFile, "Settings", "Server")
$Username=getprofilestring($INIFile, "Settings", "Username")
$Domain=getprofilestring($INIFile, "Settings", "Domain")
$Password=getprofilestring($INIFile, "Settings", "Password")
$UseParams = $driveletter + ": " + chr(34) + "\\" + $Server + "\" + $Share + chr(34) + " /user:" + $Domain + "\" + $Username + " /password:" + $Password
use $UseParams
$Error = @error
My way around it was to write all this to a file and call it. E.g.
$DriveLetter=getprofilestring($INIFile, "Settings", "DriveLetter")
$Share=getprofilestring($INIFile, "Settings", "Share")
$Share=getprofilestring($INIFile, "Settings", "Server")
$Username=getprofilestring($INIFile, "Settings", "Username")
$Domain=getprofilestring($INIFile, "Settings", "Domain")
$Password=getprofilestring($INIFile, "Settings", "Password")
$UseParams = $driveletter + ": " + chr(34) + "\\" + $Server + "\" + $Share + chr(34) + " /user:" + $Domain + "\" + $Username + " /password:" + $Password
$MapTempFile = "%TEMP%\maptemp.kix"
if exist($MapTempFile)
$RC = setfileattr($MapTempFile, 128)
del $MapTempFile
endif
$RC = open(2, $MapTempFile, 5)
$RC = writeline(2, "use " + $UseParams + chr(13) + chr(10))
$RC = writeline(2, "$$Error=@@error" + chr(13) + chr(10))
$RC = close(2)
call $MapTempFile
This worked successfully and allowed me to programmically map drives using kix. Now I've started to convert some scripts to Kix2001 Beta 2 and I see that the functionality of the command has changed. I can no longer simply hardcode a use command and call it!
e.g a file named USE.KIX simply containing the following:
use v: "\\INSTALLSERV\PACKAGES$" /user:NTDOMAIN\JOEBLOGGS /password:letmein
returns a 'Script Error: error in USE statement!' problem when called from KIX2001 Beta 2. However, It works under Kix v3.63. I know I could simply spawn a %COMSPEC% session and 'net use' the map but I loose the @error returned.
Can anyone confirm or deny that (a) there was a USE problem in Kix v3.63 and before, and (b) there is a new bug in Kix2001 which is a lot more serious!
I'm using Kix2001 on Windows 2000 Professional SP1 mapping drives to NT4 SP4 servers. However I've seen similar problems on 9x (although without /username: and /password:) and NT4.
PoD