Results 1 to 10 of 10

Thread: Execute batch file during login

  1. #1
    The LHC rulez! DataMatrix's Avatar
    Join Date
    May 2007
    Location
    Liverpool
    Posts
    511
    Thanks
    21
    Thanked
    10 times in 10 posts

    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.

  2. #2
    Senior Member
    Join Date
    Mar 2006
    Location
    London
    Posts
    296
    Thanks
    16
    Thanked
    8 times in 7 posts

    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.

  3. #3
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb

    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?

  4. #4
    The LHC rulez! DataMatrix's Avatar
    Join Date
    May 2007
    Location
    Liverpool
    Posts
    511
    Thanks
    21
    Thanked
    10 times in 10 posts

    Re: Execute batch file during login

    The batch file contains:
    @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

  5. #5
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb

    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'

  6. #6
    The LHC rulez! DataMatrix's Avatar
    Join Date
    May 2007
    Location
    Liverpool
    Posts
    511
    Thanks
    21
    Thanked
    10 times in 10 posts

    Re: Execute batch file during login

    I've tried persistent but it just keeps asking for the password and username during login.

  7. #7
    radix lecti dave87's Avatar
    Join Date
    Sep 2005
    Location
    England
    Posts
    12,806
    Thanks
    657
    Thanked
    931 times in 634 posts
    • dave87's system
      • Motherboard:
      • Asus
      • CPU:
      • i5 3470k under Corsair H80 WC
      • Memory:
      • 8gb DDR3
      • Storage:
      • 240gb SSD + 120gb SSD
      • Graphics card(s):
      • Asus HD7950
      • PSU:
      • XFX 600w Modular
      • Case:
      • Lian Li PC-A05FNB + Acoustipack
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • 2x Dell S2309W (1920x1080)
      • Internet:
      • BT Infinity Option 2

    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.

  8. #8
    The LHC rulez! DataMatrix's Avatar
    Join Date
    May 2007
    Location
    Liverpool
    Posts
    511
    Thanks
    21
    Thanked
    10 times in 10 posts

    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 >_>

  9. #9
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb

    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

  10. #10
    The LHC rulez! DataMatrix's Avatar
    Join Date
    May 2007
    Location
    Liverpool
    Posts
    511
    Thanks
    21
    Thanked
    10 times in 10 posts

    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)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. nero recode compiling volume failed
    By hvb in forum Welcome to HEXUS!
    Replies: 1
    Last Post: 02-09-2007, 10:14 AM
  2. Need help on my maxtor harddrives
    By arthurleung in forum PC Hardware and Components
    Replies: 10
    Last Post: 12-06-2007, 09:40 PM
  3. Multiple problems - help!
    By Ruggerbugger in forum Help! Quick Relief From Tech Headaches
    Replies: 7
    Last Post: 18-08-2006, 11:41 PM
  4. Nero vision express saying:'Burn process failed'
    By johnnr892 in forum Help! Quick Relief From Tech Headaches
    Replies: 15
    Last Post: 11-12-2005, 11:43 PM
  5. Batch file & copy query
    By Fatboy in forum Help! Quick Relief From Tech Headaches
    Replies: 4
    Last Post: 25-04-2005, 03:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •