Execute batch file during login
I have 2 laptops and they map drives during login and I was wondering how to make the batch file run BEFORE the desktop is shown etc.
I've tried putting it in the startup folder but it executes far too late and Windows flags up an error about the location of the desktop not existing (all the documents including desktop are stored on a diff pc).
I know it's possible to execute earlier but I can't remember how.
Re: Execute batch file during login
Is it on a domain? If so use login scripts. In a workgroup if you have XP Pro, you can set a login script on Local User Accounts. However if your running XP Home or Vista Home then I don't think it's possible.
Re: Execute batch file during login
HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Run
and call it 'aaaaa' or something so its at the top of the list?
might load before the startup directory is processed...
what does the batch file do?
Re: Execute batch file during login
The batch file contains:
Quote:
@ECHO OFF
ECHO Mapping drives...
CLS
ECHO Mapping Z: to \\HOME-PC1\files$...
NET USE Z: \\HOME-PC1\files$ password /PERSISTENT:NO
ECHO Mapping Y: to \\HOME-PC1\users$...
NET USE Y: \\HOME-PC1\users$ password /PERSISTENT:NO
ECHO DONE!
EXIT
Re: Execute batch file during login
why dont you make the mapping persistant? or are there multiple users on each laptop (thus multiple directories on HOME-PC1 for each user)...
does it not execute in time if you shove the entry in the registry rather than in the startup folder? try the HKEY_LOCAL_MACHINE\...\RunOnce folder instead of plain 'HKEY_Local_Machine\...\Run' :)
Re: Execute batch file during login
I've tried persistent but it just keeps asking for the password and username during login.
Re: Execute batch file during login
I got around that by making the user accounts the same on both PCs (much like you would have in a domain based network) So Dave on one pc has the same password as Dave on another, hence it uses the same login to connect to the networked drives.
Re: Execute batch file during login
Yeah but if the users don't want passwords then the user on the PC with the shares on wont allow a blank password >_>
Re: Execute batch file during login
create additional non-passworded accounts on the HOME-PC1 depending on how secure you want it all to be :)
Re: Execute batch file during login
Well I don't want user's accessing each others documents, so they get an access denied message if they try to access someone elses shares accidentally (they wouldn't do it on purpose)