That gets us to an interesting point Glen, check out this line
 Code:
Use $drive: $share /user:$StringUsername /password:$StringPassword

There is definantly something wrong with this line. What is the proper syntax for this line with novarsinstrings on?


also what is the difference between $=novars in strings or $variable name=no vars in strings?


Final comment, This is where everything gets frustrating
 Code:
$System = CreateObject("Kixtart.System")

$Form = $System.Form()
$Form.Caption					= "AS400 Login"
$Form.ScaleHeight				= 200
$Form.ScaleWidth				= 250
$Form.FontName					= "Arial"
$Form.FontSize					= 9

$FrameBanner 					= $Form.PictureBox
$FrameBanner.BackColor				= $Form.RGB(255,255,255)
$FrameBanner.Height 				= 70
$FrameBanner.Left				= 0
$FrameBanner.Top				= 5
$FrameBanner.Width				= 250
$FrameBanner.FontSize				= 20
$FrameBanner.FontName				= "lucida"
$FrameBanner.ForeColor				= 0
$FrameBanner.FontBold				= 1
$FrameBanner.PrintXY(70,0,"As400 Login")
$FrameBanner.FontSize				= 14
$FrameBanner.ForeColor				= $Form.RGB(0,0,0)
$FrameBanner.PrintXY(71,28,"@FULLNAME")
$FrameBanner.FontBold				= 0
$FrameBanner.FontSize				= 8
$FrameBanner.ForeColor				= $Form.RGB(0,0,0)
$FrameBanner.PrintXY(71,50,"Type in your AS400 Credentials")
$FrameBanner.FontSize				= 8


; Banner Picture
$PictureBanner					= $FrameBanner.Image
$PictureBanner.Picture				= "%WINDIR%\System32\shell32.dll;18"
$PictureBanner.Height				= 60
$PictureBanner.Left				= 5
$PictureBanner.Top				= 5
$PictureBanner.Width				= 60

$TextBoxUsername				= $Form.TextBox
$TextBoxUsername.Height				= 19
$TextBoxUsername.Left				= 50
$TextBoxUsername.Top				= 85
$TextBoxUsername.Text				= username
$TextBoxUsername.Width				= 161

$TextBoxPassword				= $Form.TextBox
$TextBoxPassword.Text				= "Password"
$TextBoxPassword.Height				= 19
$TextBoxPassword.Left				= 50
$TextBoxPassword.PasswordChar 			= "*"
$TextBoxPassword.Top				= 110
$TextBoxPassword.Width				= 161

$CmdUserLogin					= $Form.CommandButton("Login")
$CmdUserLogin.Default				= 1 ; True
$CmdUserLogin.FontName				= "Arial"
$CmdUserLogin.FontSize				= 10
$CmdUserLogin.FontBold				= 1
$CmdUserLogin.Left				= 50
$CmdUserLogin.Top				= 140
$CmdUserLogin.Width				= 78
$CmdUserLogin.Height				= 19
$CmdUserLogin.OnClick				= "CmdUserLogin_Click()"

$CmdExit	 				= $Form.CommandButton("Cancel")
$CmdExit.FontName				= "Arial"
$CmdExit.FontSize				= 10
$CmdExit.FontBold				= 1
$CmdExit.Top					= 140
$CmdExit.Width					= 80
$CmdExit.Height					= 19
$CmdExit.Left					= 133
$CmdExit.OnClick				= "quit()"

Dim $StringUsername
Dim $StringPassword


$Form.Show
$TextBoxUsername.SetFocus

While $Form.Visible
  $ = Execute($System.Application.DoEvents)
Loop




Function CmdUserLogin_Click()

	If $TextBoxUsername.Text = ""
		$= $Form.MsgBox("You must specify a username before clicking LOGIN.", "Invalid Username")
		$TextBoxUsername.Text = $StringUsername
		Exit Sub
	Else
		$StringUsername = $TextBoxUsername.Text
	EndIf

	If $TextBoxPassword.Text = ""
		$= $Form.MsgBox("You must specify a password before clicking LOGIN.", "Invalid Password")
		$TextBoxPassword.Text = $StringPassword
		Exit Sub
	Else
		$StringPassword = $TextBoxPassword.Text
	EndIf


	$Form.Hide

	$drive="B"
	$server="\\Qs1045n5m\"
	$share="Benefits"

	$share='$server$share'

	;? "variables are" $share $Stringusername $Stringpassword

	? "mapping $drive to $share"
	Use "$drive:" /Delete
	Use "$drive:" $share /user:$StringUsername /password:$StringPassword
	
	


	EndFunction


This works,and there is no real difference between this, or how its executed from the login script. It collects the user/pass and maps the drive...so why does this work with one of the drives through login script, but not both, when this works with both.


Edited by duo (2008-02-12 08:18 PM)