11
6
Sometimes during the same Windows (Vista) session i have to connect to the same (samba) file server in a workgroup (no domain) as another user. It seems Windows has cached the current connection with user info. To force a new authentification i run a batch script:
@echo off
net use * /delete /y
net use * /delete /y
net use * /delete /y
net use * /delete /y
net use * /delete /y
But this sometime works and sometimes doesn't and force me to close the Windows session.
Is there a way to completely disconnect from actual shares to login as a new user.
Update
I have no program open, no drive letter connected and "net use" empty but still the IPC$ share open on the samba server (smbstatus).
Now adding
net use \\server\IPC$
and again
net use * /delete /y
And "net use" complains about open files or searches in folders with \server\IPC$ (message in spanish).
I think Vista is still holding the share for searching and indexing.
Update 2
I think i get this now: i stopped "Windows Search" service and after running the batch i get asked again for credentials.
Also note that cases where you've done something like open a file on that share can leave an application with a directory open, which will also prevent the share from completely going away. – Michael Kohne – 2012-12-18T14:42:57.717
Except now you get no indexing. Adding a netbios alias is a much cleaner solution. – djhowell – 2009-11-13T17:00:07.540
On Windows 7 indexing is optional on a per-drive and even per-directory tree basis, I'm sure there must be similar settings for Vista. – kmarsh – 2009-11-13T18:11:35.120