Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 当文件夹名称包含空格时映射驱动器的批处理文件_Batch File - Fatal编程技术网

Batch file 当文件夹名称包含空格时映射驱动器的批处理文件

Batch file 当文件夹名称包含空格时映射驱动器的批处理文件,batch-file,Batch File,我正在尝试使用批处理文件映射驱动器。 我试过: net use m: \\Server01\myfolder /USER:mynetwork\Administrator "Mypassword" /persistent:yes 它很好用。当我尝试映射名称上带有空格的文件夹时,会出现问题: net use m: \\Server01\my folder /USER:mynetwork\Administrator "Mypassword" /persistent:yes 我尝试过使用引号,使用m

我正在尝试使用批处理文件映射驱动器。 我试过:

net use m: \\Server01\myfolder /USER:mynetwork\Administrator "Mypassword" /persistent:yes
它很好用。当我尝试映射名称上带有空格的文件夹时,会出现问题:

net use m: \\Server01\my folder /USER:mynetwork\Administrator "Mypassword" /persistent:yes
我尝试过使用引号,使用myfold~1,但没有任何效果

一个简单的方法是重命名文件夹,但我在300多个工作站中映射了它,所以这不是一个好主意

net use "m:\Server01\my folder" /USER:mynetwork\Administrator "Mypassword" /persistent:yes 

不起作用?

每当处理文件名中的空格时,请使用引号

net use "m:\Server01\my folder" /USER:mynetwork\Administrator "Mypassword" /persistent:yes

我刚刚创建了一些目录,共享了它们,并使用以下工具进行了映射:

net use y: "\\mycomputername\folder with spaces"

因此,此解决方案获得“在我的机器上工作”证书。你得到了什么错误代码?

我不确定这会对你有多大帮助,因为我曾经需要一个批处理文件来打开一个游戏,该.exe在一个空白文件夹中(duh!),我尝试了:启动“C:\Fold 1\Fold 2\game.exe”和启动C:\Fold 1\Fold 2\game.exe-没有工作,然后我尝试了

   START C:\"Fold 1"\"fold 2"\game.exe and it worked 
希望有帮助:)


请注意,第一个
引号位于前导的
\
之前,第二个引号位于文件夹名称的末尾。

net使用“m:\Server01\my folder”/USER:mynetwork\Administrator“Mypassword”/persistent:yes不起作用为什么将驱动器号作为UNC的一部分?那你为什么还留着四月一日的墓地呢?:-)这是鬼魂的建议。无论如何,net使用m:“\Server01\my folder”可以工作。谢谢chalup@paxdiablo-因为我喜欢它!(gravatar,而不是驱动器号)为什么将驱动器号作为UNC的一部分?在批处理文件中使用时,Windows 7不起作用。
net use f: \\\VFServer"\HQ Publications" /persistent:yes