I am using below code to create folders and subfolders at batch file location

@echo off
MD 1.Inputs 2.Documents 3.Status 4.Production 5.Deliveries 6.Tools 2.Documents\Technical 2.Documents\General 6.Tools\Inputs 6.Tools\Testing

Now, I want to have above folders created in a parent folder with user input name but these folders are to be created with parent folder on a network path

i have put in below line to prompt for folder name

set /p FOL=enter your folder name:

I am not sure, How to combine both the codes and add command to specify network path on a server to create folders

Is there a way to run batch files on the network path from the batch file on a local machine

Thanking you in advance


set /p FOL=enter your folder name:

Leads to a variable %FOL% which you can hand over to the command to create a directory:

 md %FOL%

You might need to do cd before creating the folder.

In case UNC paths don't work on the network share, you can also mount it as a drive letter with net use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.