Profile

Click to view full profile
Hi, I'm Veerapat Sriarunrungrueang, an expert in technology field, especially full stack web development and performance testing.This is my coding diary. I usually develop and keep code snippets or some tricks, and update to this diary when I have time. Nowadays, I've been giving counsel to many well-known firms in Thailand.
view more...

Friday, February 28, 2014

Access shared network from Windows Command Prompt

To access network shared folder from Command Prompt, it cannot use cd command. In order to access shared folders, we need to mount it as a new drive by run the following command:
// Method 1
net use [drive letter]\\[machine]\[folder]
// Method 2
pushd \\[machine]\[folder]

// Example 1
net use z: \\machine_name\shared_folder_name
// List folders on shared drive
dir net use z:

// Example 2
pushd \\machine_name\shared_folder_name
Both methods can do the same things, but the different is the second method will allocate and change current directory to the new drive automatically by the allocated drive is started from unused reversed alphabetical order.
To remove mounted drive, we can use the following command to delete it.
net use [drive letter] /delete

// Example
net use z: /delete