I am seeking your help with a problem on a logon script.
I configured my samba so that users use a script with their name in .bat (%u.bat) upon login, which is generated on the fly by another script to mount network drives according to groups.
One small problem: the script starts up fine at startup, but it seems to execute certain lines multiple times, and I can't figure out why.
Explanation:
I have my generated logon script which is:
Code: Select all
@echo off
net use /persistent:no * \\ubuntu\test
net use /persistent:no * \\ubuntu\secdir
If I run the script manually from the network, there are no problems.
When the session opens, the script runs but mounts each reader twice as if it were reading two lines (the personal drive is mounted by Samba beforehand)

Other remarks if I edit the file userI run a .bat file under Windows, and when I log in with this file modified by Windows, it works.
I'm using unix2dos to convert line breaks to Windows format. I've tried with sed and awk with the same result.
Does anyone have any leads?
I'm a bit desperate right now :/
