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 OlsenData Warehouse Architect / DBACommented:
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:
NET USE G: /DELETE

Kent
0
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.
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
NET USE \\%computer%\ipc$ /user:%username% %Password%
\\%computer%\C$

Open in new window

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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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%
\\%computer%\C$

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?
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
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
\\SomeComputer\C$

Open in new window

0
jamil MohammadAuthor Commented:
i didn't used /password,
this is the error message only when i copy past your advised code syntax.
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
Like this?
netuse.png
0
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$
1
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.