On Windows 7, Map network drive before login after startup

Our company has a windows 7 desktop, work in workgroup, not domain, shared by different users.
My requirement is when every user logs in, there will be a network drive Z connected to a network shared folder.
The network drive is in domain server, accessed by domain user.

I made a bat file to do it.

I created a scheduled task to run at startup, it runs and "completes", but never maps the drive.  If I run the scheduled task manually, it runs and "completes", but never maps the drive.  If I run the .bat file manually, it works fine.

I collected solution on website, like remote Permanuent:Yes, add Regeditster file key "EnableLinkedConnections"=dword:00000001

But no locky.

Who can provide me a useful way or tool to do it?
Snowy CanadaNetwork AdministratorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JohnBusiness Consultant (Owner)Commented:
Put the batch file on the desist pop and ask users to connect,

You can also put the startup script in gpedit.msc , user configuration, scripts.
Lee W, MVPTechnology and Business Process AdvisorCommented:
If you have a domain it's silly not to have the workstation on the domain.  It causes problems.  This being one of them because in a domain, mapping the drive could be done through Group Policy or logon script.

I don't know what your parameters/settings are for the task - you didn't post them.  I would probably just create a batch file and put it in the "all users" startup group, typically, C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
Jose Gabriel Ortega CastroCEO Faru Bonon IT - EE Solution ExpertCommented:
Hi Snowy.

Step 1. Do not use a task scheduler for this tasks since it does't have any sense, it's not the way you do "Log on Script"
Step 2. Take your bat  and modify it accordinly to this

REM Remove all existing 
net use * /d /y

REMConnecto the Z: drive using a domain and username for each invidual computer
net use Z: \\<ip or servername>\<share> /user:<domain>\<username> <password>

Open in new window

Save this into a .bat file and modify accordinly domain, ip or servername and password values, remove all <> symbols.

Step 3. Now on your local computer (the computer in the workgroup out of the domain) run:
Windows + R  and write GPEDIT.MSC

Windows means hit the keyboard the windows key and press R at the same time to get the "run" windows.

On Local Computer Policy go to Windows Settings/Scripts/Startup
Then click "show files" and copy the .bat file into that folder.
Then come back to the "Startup properties" windows and click Add, and finally select the .bat file

and you're done.

Come back to the Windows+R (run windows) and use this time: Gpupdate /force
and that's it.

TRy it and let us know ;)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Snowy CanadaNetwork AdministratorAuthor Commented:
Thanks to everyone. John and Jose provide same solution, I actually solve it following John's solution.
Thank Jose provides each step of solution.
Thank Lee. I tested, Windows 7 doesn't have folder C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
JohnBusiness Consultant (Owner)Commented:
Thank you for the follow up and I was happy to help.
Jose Gabriel Ortega CastroCEO Faru Bonon IT - EE Solution ExpertCommented:
I had the question open some time go I didn't get the john's answr loaded :) but happy to help
Lee W, MVPTechnology and Business Process AdvisorCommented:
I tested, Windows 7 doesn't have folder C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
I'm guessing you looked for it and didn't actually try to go into it.  ProgramData is a hidden folder.  Look again.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.