I made a batch script that lets the user enter a number and then loops to create that number of folders, but I also want to share these folders and don't know how to do it. Here's the code:
@echo off
cd c:\
set name=0
set /p name="请输入机号:"
set t=name
for /l %%a in (1 1 %name%) do md %%a
First, for sharing folders in a batch script, you can use the `net share` command. You can modify the script like this:
@echo off
cd c:\
set name=0
set /p name="请输入机号:"
set t=name
for /l %%a in (1 1 %name%) do (
md %%a
net share "folder_%%a"=c:\%%a
)
This will create the folders and then share each one with the name "folder_序号". But note that you might need appropriate permissions to do the sharing.
@echo off
cd c:\
set name=0
set /p name="请输入机号:"
set t=name
for /l %%a in (1 1 %name%) do md %%a
First, for sharing folders in a batch script, you can use the `net share` command. You can modify the script like this:
@echo off
cd c:\
set name=0
set /p name="请输入机号:"
set t=name
for /l %%a in (1 1 %name%) do (
md %%a
net share "folder_%%a"=c:\%%a
)
This will create the folders and then share each one with the name "folder_序号". But note that you might need appropriate permissions to do the sharing.
