Reconnect mapped network drives in Windows OS using Command Prompt commands


Sometimes when booting into Windows, the OS does not reconnect mapped network drives even though the mapping was configured with the “Reconnect at sign-in” option.

Although there are free Third Party software available that can automatically reconnect your mapped network drives, I would rather be able to do this using built-in tools than add more unnecessary software to my system. I came across a response someone had written in a blog about using Third Party and showed how you could use a few Command Prompt commands using the “net use” command. I’ve lost the link to that blog article, but I did copy that code and built my own batch script around it. The key change I wanted to make was to put in a limited number of attempts just in case the NAS drive was down.

This is the code I use which I put in a batch file which runs via a shortcut from within the Windows “StartUp” directory so the code is run whenever Windows logs in. I recognise the code is a bit ugly and some of you scripting experts can make it a bit more elegant. But it works for me and I didn’t want to spend too much time on this when I could be doing other more fun things! Note that this has only been tested in Windows 10 Pro 64-bit.

@ECHO Please wait whilst we reconnect your network drives.
TITLE Mapping network drives
SET me=%~n0
SET parent=%~dp0

SET counter=1
if %counter% EQU 5 (
 ECHO Connection to D:\ drive timed-out
ECHO Attempt %counter%. Connecting to D:\ drive
TIMEOUT /t 5 /nobreak >NUL
 ECHO Attempt successful. D:\ drive connected
 SET /A counter=%counter%+1
 GOTO Start

@ECHO Please wait, script is closing.
TIMEOUT /t 5 /nobreak >NUL
@ECHO off
@EXIT /B 0


Central Afghanistan

So I found myself smack in the middle of Afghanistan. It was cold, remote, and desolate. A couple of buildings served as a resting place for truck drivers hauling their goods across the country. It was a welcome relief after spending so much time on the road (dirt tracks mostly), a chance to stretch the legs and seek shelter from the dust. And onward, our goal to reach the fabled Minaret of Jam.

Novice Buddhist monk

I took this photo in January 2014 of a novice Buddhist monk during the Ananda Pagoda Festival in Bagan, Myanmar (Burma). It was early in the morning, a slight chill in the air, with many hundreds of monks and novice monks; the largest gathering of monks I’d witnessed. And there, a boy, with that look.
Novice Buddhist monk

Long neck Padaung

When I took this shot I thought that the photo would be a failure due to the extreme dynamic range involved. It was hand-held, shooting into the sun with the main subject being the Padaung woman in the shade. I revisited that photo this weekend and found, to my surprise, that it had a lot of information, and that it was close to my vision. So here it is in all its glory.

Padaung woman


The dry, barren, and rocky landscape of Spitzkoppe in Namibia. Weathering has sculpted interesting shapes into the rocks and, juxtaposed against the night sky, provided an excuse to camp here and photograph the area in August 2015.

Spitzkoppe landscape

A starry night

Between the sand dunes of the south and the dry savannah of the north, a vast and varied landscape meet you head-on as we travelled through Namibia in our African overland truck. Near Spitzkoppe, we were surrounded by a dry, dusty and rocky environment. Hot during the day, and chilly at night, but away from the city lights, this area provided some of the clearest dark skies in the world and, with it, a wonderful opportunity to take photos of the night sky. And, indeed, the views were breath-taking, and I’ve captured some of these moments in my photos on my website.

Later that night, although we had brought our tents, it seemed a good idea at the time that we would just sleep under the stars, with nothing but a sleeping bag between us and the heavens. Having bedded down for the night, I lay there on a rocky outcrop exposed to the elements, and reflected on the doings of the day. As I looked up at the stars, the immensity of the Milky Way and its galactic core bearing down on me, I marvelled at the grandeur of the universe. With my trusty camera next to me, I snapped this view; it was the last thing I saw before I fell asleep. It was a night to remember.

Milky Way

Think to break free

A great crime committed against individuals and society is to be told what to think and not how to think, and where the tools of critical thinking allowing us to reason and make rational sense of the world are rejected. In particular, there are a multitude of institutions and people who follow and apply dogma, who discourage thinking and who discourage enquiry. This video by TheraminTrees describes how he was treated and how he managed to break free.

Himba girl

The Himba, a semi-nomadic people, are located in northern Namibia and in southern Angola. Last year, I spent a couple or so days in the most northernmost area of Namibia mingling with the Himba in their small village, and this young girl was out-and-about in the village.

Himba girl

A short interview with Sarah Haider

A short interview with Sarah Haider in which she speaks about Islam, her apostasy, and her work with the Ex-Muslims of North America.

I have also previously linked to another talk by Sarah at regarding the hostility of the left.