Jump to content

Recommended Posts

Posted

Hello I want to conect to a Network with DriveMapAdd.

This worked just fine but when you restart the Computer the Mapped drive is gone.

So i used the persistent mapping flag and that seemed to work, too.

However when the Computer is restarted I cant connect to the Network because it doesnt remember the Username and password I ave it the first time.

How do I fix this?

My Code:Func

setdrivem()
    DriveMapAdd("M:", GUICtrlRead($driveM),1, GUICtrlRead($netzuser),GUICtrlRead($netzpassword) )
EndFunc

$netzuser and $netzpassword are set earlier in the gui and it works right after executing the script but i want it to stay connected

Posted
#cs
[Mapping One]
Drive=M:
UNC=\\Server\Share\Path
User=MyUserName
PlainTextPassword=T0p53cRet

#ce



$ini="C:\temp\Mapping.ini"
$sect="Mapping One"
$Default="!-ERROR-!"
$Persistent=1


$Key="Drive"
$Drive=IniRead($ini,$sect,$Key,$Default)

$Key="UNC"
$UNC=IniRead($ini,$sect,$Key,$Default)

$Key="User"
$User=IniRead($ini,$sect,$Key,$Default)

$Key="PlainTextPassword"
$PlainTextPassword=IniRead($ini,$sect,$Key,$Default)


DriveMapAdd($Drive,$UNC,$Persistent,$User,$PlainTextPassword)

cu, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...