What is the command to use in a batch file to open a folder?

G

Guest

I need to connect to a network mapped drive to "activate it" before starting
a program that uses that drive for storage, and I want to incorporate the
command in a batch file. This batch file will open the mapped drive and then
close the drive and start a program. I have the method for starting the
program I want but I dont know the command for windows to open a folder.
 
D

Dave Patrick

net use X: /d
net use X: \\servername\sharename
do some work
net use X: /d


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
G

Guest

Thanks Dave. I will give that a shot.

Dave Patrick said:
net use X: /d
net use X: \\servername\sharename
do some work
net use X: /d


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

Microtool Kevin said:
I need to connect to a network mapped drive to "activate it" before
starting
a program that uses that drive for storage, and I want to incorporate the
command in a batch file. This batch file will open the mapped drive and
then
close the drive and start a program. I have the method for starting the
program I want but I dont know the command for windows to open a folder.
 
G

Guest

I removed the lines with the /d commands. I dont want to delete the folder, I
just wanted to access it to "activate" it. The commands does work and
accomplishes what I need.

A bit of background for the request....
We have a network at my facility that utilizes W2K machines that collect SPC
data that is stored on a networked drive. The W2K machines try to connect to
the "mapped" drive before the network signs the machines on. When the
operators activate the SPC program it will balk a bit because it cannot find
the assigned drive for the templates and information because the network
hasn't logged them in. The operators then have to open My Computer, double
click the mapped drive, this "activates" it, then the SPC program works fine.
The one hitch in the whole scenario is that some/most of our operators are
not very computer savvy so they dont understand why this needs to be
performed and as such often times forget to do it. This requires them to call
me (the QA guy) to "fix" the computer.
Now that I have this batch program, they simply double click the icon for
SPC and it opens the networked folder then the SPC program and all works well.

Again,
Thanks for the help.

Dave Patrick said:
You're welcome.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

Microtool Kevin said:
Thanks Dave. I will give that a shot.
 
D

Dave Patrick

net use X: /d

does not delete any folders. It deletes the drive mapping. Add your shell
script to;

%ALLUSERSPROFILE%\Start Menu\Programs\Startup

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
G

Guest

I tried adding the script to the startup folder but the startup tries to
connect to this networked folder using the script before the network is
connected. This causes the same situation as not using the script at all.

What I did to remedy this was to include the target shortcut that starts the
SPC program as a line in the script and directed the users to start the
program with a shortcut to the script. I used the icon from the SPC program
to label the shortcut so that the users "see" the same thing they did before
the script was used. My only problem now is that if the users need to open a
second instance of the SPC program (to enter data into a different part using
the same station) I have to instruct the users to use the original shortcut
for the SPC program.

I think I may rename the script shortcut to "Start Here" and then the
shortcut for the SPC program would stay the same.

Dave Patrick said:
net use X: /d

does not delete any folders. It deletes the drive mapping. Add your shell
script to;

%ALLUSERSPROFILE%\Start Menu\Programs\Startup

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

Microtool Kevin said:
I removed the lines with the /d commands. I dont want to delete the folder,
I
just wanted to access it to "activate" it. The commands does work and
accomplishes what I need.

A bit of background for the request....
We have a network at my facility that utilizes W2K machines that collect
SPC
data that is stored on a networked drive. The W2K machines try to connect
to
the "mapped" drive before the network signs the machines on. When the
operators activate the SPC program it will balk a bit because it cannot
find
the assigned drive for the templates and information because the network
hasn't logged them in. The operators then have to open My Computer, double
click the mapped drive, this "activates" it, then the SPC program works
fine.
The one hitch in the whole scenario is that some/most of our operators are
not very computer savvy so they dont understand why this needs to be
performed and as such often times forget to do it. This requires them to
call
me (the QA guy) to "fix" the computer.
Now that I have this batch program, they simply double click the icon for
SPC and it opens the networked folder then the SPC program and all works
well.

Again,
Thanks for the help.
 
D

Dave Patrick

You can add a delay to your shell script if your network isn't ready. (seems
strange in of itself)

ping -n 10 127.0.0.1 > NUL

would add ~ a 10 second delay.


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
G

Guest

That sounds like a good suggestion. I will present it to my IT guy for his
approval.

Dave Patrick said:
You can add a delay to your shell script if your network isn't ready. (seems
strange in of itself)

ping -n 10 127.0.0.1 > NUL

would add ~ a 10 second delay.


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

Microtool Kevin said:
I tried adding the script to the startup folder but the startup tries to
connect to this networked folder using the script before the network is
connected. This causes the same situation as not using the script at all.

What I did to remedy this was to include the target shortcut that starts
the
SPC program as a line in the script and directed the users to start the
program with a shortcut to the script. I used the icon from the SPC
program
to label the shortcut so that the users "see" the same thing they did
before
the script was used. My only problem now is that if the users need to open
a
second instance of the SPC program (to enter data into a different part
using
the same station) I have to instruct the users to use the original
shortcut
for the SPC program.

I think I may rename the script shortcut to "Start Here" and then the
shortcut for the SPC program would stay the same.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top