mounting a samba share in windows 8

I normally have  a .bat file with
net use f: /delete
net use f: \\192.168.1.2\share /USER:user password

load in the startup folder

but I have a problem when the .bat file runs, networking has not been established yet, so not connection to the server is done after boot.
Is there a solution or a better way. I want to use a script to make sure the connection is established.
georgopanosAsked:
Who is Participating?
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.

arnoldCommented:
Is the script part of a GPO?  
You can configure/set a requirement that network be established prior to allowing login/running of scripts.

An option could be to use Preferences or GPO to push settings.
0
georgopanosAuthor Commented:
No it is a simple BAT file that is placed in the startup folder and launched.
0
arnoldCommented:
Is the system part of a domain or is a stand alone?
Presumably wireless setup?
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Lionel MMSmall Business IT ConsultantCommented:
You can put a delay in your bat file so that it waits until networking is established before the batch file runs. Also just know that putting a username and password in a batch file is a security risk. You may want to convert your batch file to an exe--there are free tools on cnet.com for this.
0

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
georgopanosAuthor Commented:
No domain, yes standalone, and no wireless. I find it hard to accept there is not something built into windows to re establish samba connections.
0
arnoldCommented:
See if you map the drive with the reconnect option, the share will remain and should do it.
There is through local policy that the network must be established before login is allowed.
0
georgopanosAuthor Commented:
That would be very helpful where do I exactly setup the policy for establishment of network before login?
0
slubekCommented:
Use net use f: \\192.168.1.2\share /USER:user password /persistent:yes once. Next time, after logging in, you'll see that drive f: is mounted even if network is down. When network is up you can use drive f: without need to mount it.
0
georgopanosAuthor Commented:
I found the policy and that corrected my problem thanks.
0
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
Microsoft Legacy OS

From novice to tech pro — start learning today.