我有一些困难让Microsoft远程桌面的文件夹redirectfunction使用命令行应用程序。
我已经在OS X RDP客户端中configuration了一个用于redirect的文件夹,其中'name'字段为'andrew','path'字段为/ Users / andrew。 这工作正常。 当我连接到服务器时,我看到“计算机”下的redirect文件夹,我可以用graphics浏览它。 在命令提示符下,NET USE也显示它:
C:\Users\Administrator>net use New connections will not be remembered. Status Local Remote Network ------------------------------------------------------------------------------- \\TSCLIENT\andrew Microsoft Terminal Services The command completed successfully.
但是,没有与该文件夹关联的驱动器号。 这是我的阻挡者。 这个redirect的重点是允许我在Windows机器上使用命令行编译工具,但是在Mac上编辑和操作源代码。 cmd.exe shell无法处理UNCpath,而powershell不是一个选项,因为构build实用程序不可避免地将shell放到cmd中来执行诸如运行vcvars等等,如果CWD是UNCpath,则会失败。 所以,可悲的是,我真的需要一个映射的驱动器号或这是一个不行。
如果我尝试使用NET USE或graphics“映射networking驱动器”来build立一个驱动器号,它似乎工作:
C:\Users\Administrator>net use Y: \\TSCLIENT\andrew The command completed successfully.
并且重新运行NET USE将显示驱动器:
C:\ Users \ Administrator> net use新的连接将不会被记住。
Status Local Remote Network ------------------------------------------------------------------------------- Y: \\TSCLIENT\andrew Microsoft Terminal Services \\TSCLIENT\andrew Microsoft Terminal Services The command completed successfully.
但是,如果我试图实际访问Y驱动器,它不起作用:
C:\Users\Administrator>y: The device is not connected.
随后,如果我尝试从graphicsshell中访问最初工作的redirect文件夹,我发现它不再正常工作。 我现在得到一个对话说
\\tsclient\andrew is not accessible. You might not have permissions to use this network resource. Contact the administrator of this server to find out if you have access permissions. Attempt to access invalid address.
看起来,我并不是唯一遇到过这个困难的人 ,但是这个“答案”和它所链接的文件是毫无用处的。
如果没有驱动器盘符,文件夹redirect对于我的需求是不可用的,但是如果有办法做到这一点,这将是非常有帮助的。
有任何想法吗? 这使我摆脱了在Windows上testing的同时需要rsync来源,这将是一个巨大的生产力增益。
使用符号链接而不是驱动器号,请在login到TS服务器时在.BAT中放入以下内容:
MKLINK /DC:\Andrew \\tsclient\Andrew
这个符号链接将在重新启动后保持不变,并将删除驱动器号的要求。
开始新的RDP会话(从当前会话注销后)。 然后,创build一个包含这些行的batch file:
net use \\tsclient\andrew /delete /persistent:yes net use \\tsclient\andrew /delete net use y: \\tsclient\andrew
运行该batch file。