how to open C drive from network PC

i tried to user the below command via batch script file

START \\%computer%\C$ /user:%username% %Password%

but every time it keep asking for the username and password.
is their any way that i can get it to open the C drive for any computer that i input in the batch file

note: i input in the batch file the username and password and PC name
so i use %username% and %password% and %computer% from my input when i run the batch file.

any advise?
jamil MohammadAsked:
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.

Kent OlsenDBACommented:
Hi Jamil,

NET USE will allow you to map and unmap a shareable drive with a batch script.

:: Connect drive as G:
NET USE G: \\computername\sharename
:: The sharename is available locally as drive G:

::  Delete the connection to G:

JohnBusiness Consultant (Owner)Commented:
You may need to (probably need to) share the target drive / folder to the user name trying to access it. It the network user name is different from the target machine, you may need to add the network user name and password to the target machine.

Make sure in Network Sharing Advanced Properties that User names and passwords are required. Disables home group.
Shaun VermaakTechnical SpecialistCommented:
NET USE \\%computer%\ipc$ /user:%username% %Password%

Open in new window

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
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

jamil MohammadAuthor Commented:
i have tried what Shaun Vermaak advised as the below syntax but it didn't work --> the Option /Password xxxxxxxx is unknown!
NET USE \\%computer%\ipc$ /user:%username% %Password%

it's not mandatory to assign a drive letter for net use.
but when i use START \\%computer%\C$  it pop up a new windows explorer and asking for login username and password.
now i need the same way but to open automatically by getting the username and password from my input in the batch file.

the idea is that i need from my PC to open overy 500 network computers C drive to do a task related to software installation and some other tasks.
i want this batch to work perfectly without asking to login for each computer C,,,, it will be a pain
any idea?
Shaun VermaakTechnical SpecialistCommented:
i have tried what Shaun Vermaak advised as the below syntax but it didn't work the Option /Password xxxxxxxx is unknown!
I did not say use /Password
NET USE \\SomeComputer\ipc$ /user:Administrator Password1

Open in new window

jamil MohammadAuthor Commented:
i didn't used /password,
this is the error message only when i copy past your advised code syntax.
Shaun VermaakTechnical SpecialistCommented:
Like this?
jamil MohammadAuthor Commented:
Thank you very much  Shaun Vermaak.

it's working now with the below 2 lines:

net use \\%Computer%\ipc$ /user:%user% %pass%
start \\%Computer%\C$
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 Batch

From novice to tech pro — start learning today.