Hi Bilou,
QUOTE (bilou_gateux @ Aug 3 2007, 08:05 AM)

Thanks for the detailled explanation so far.
Although i use an ENU Windows OS, i don't like to have some data values hardcoded for portability reasons.
Avec plaisir! Protability (especially concerning localizations) was also my main concern.
QUOTE (bilou_gateux @ Aug 3 2007, 08:05 AM)

A lot of freeware can help us to find the friendly name of the guest account.
.....
Thanks for pointing this out. The output of
lg . -lu seems to be not structured enough to extract the user account independently of the language used (at least on my Win2k machine). Unfortunatelly I couldn't download
CollectSID, so I found a way that utilizes
PsGetSID, which can be downloaded by everyone. Place PsGetSID.exe where also your PXEServer.cmd script is, and in PXEServer.cmd replace these lines
CODE
Set PXES__Result0=
For /F "delims=\ tokens=8" %%a in ('reg.exe query HKLM\SAM\SAM\Domains\Account\Users\Names') do (
If not "%%a"=="" Net.exe User %%a /Active:Yes /PasswordReq:No > Nul
Cacls.exe "%PXES__PXEPath%" /T /E /C /G %%a:C > Nul 2> Nul
Cacls.exe "%PXES__PXEPath%" /T /E /C /P %%a:C > Nul 2> Nul
:: Raising security to 'Read' (instead of 'Change') would make XPE complain about some 'Registration' directory
Call "%~f0" PXES__StrCat " /Grant:%%a,Change"
)
:: WinXP's Net.exe doesn't know the '/Grant:...' command
Net.exe Share PXE="%PXES__PXEPath%" /Unlimited /Cache:None %PXES__Result0% > Nul 2> Nul
with these
CODE
For /F %%a in ('"%~dp0PsGetSID.exe" ^2^> Nul') do Set PXES__Guest=%%a
For /F "delims=\ tokens=2" %%a in ('"%~dp0PsGetSID.exe" %PXES__Guest%-501 ^2^> Nul') do Set PXES__Guest=%%a
Cacls.exe "%PXES__PXEPath%" /T /E /C /G %PXES__Guest%:C > Nul 2> Nul
Cacls.exe "%PXES__PXEPath%" /T /E /C /P %PXES__Guest%:C > Nul 2> Nul
:: Raising security to 'Read' (instead of 'Change') would make XPE complain about some 'Registration' directory
Net.exe Share PXE="%PXES__PXEPath%" /Unlimited /Cache:None /Grant:%PXES__Guest%,Change > Nul 2> Nul
:: WinXP's Net.exe doesn't know the '/Grant:...' command
I tried the first two lines and it determined my Guest account correctly (on my Win2k machine). I cannot try in a Bart-environment right now so please report if it's working.
If it works, I consider updating my plugin with this, but I'm not sure right now (it would add the option of using it outside of Bart, but also would increase size, would need another file from the net, and booting from outside of Bart is not the main purpose of the plugin). ...???
Yours,
KeiraEdit: Corrected the typos reported by Bilou and Jaclaz, so it's easier for visitors to copy things out of here. Also added the
Nul-redirection. Thanks for this!
Keira