cmd.exe命令行字符串限制 [英] cmd.exe command line string limits

查看:654
本文介绍了cmd.exe命令行字符串限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在从一个oracle查询中假脱机文件,将一个位置的内容复制到另一个位置。

I've been working on spooling a bat file from a oracle query that would copy contents from one location to another,

现在生成的命令长度大于255个字符,例如

Now that command that are getting generated are of lengths that are greater than 255 characters, e.g

C:> copy x y ( where len (x+y) > 255)

因为这是抛出一个错误,有没有办法管理这种情况来增加命令长度?

As this is throwing an error, is there a work around to manage this kind of situation to increase that command length?

PS一些路径+文件名的长度大于259个字符,我发现,有少争辩

P.S. Some paths+filenames are of length that are larger that 259 characters, to which I found that say there is less to argue

推荐答案

您可以使用 subst 使用驱动器号命名您的工作的两个子目录。显然,这不是真正的,但是逻辑驱动器,但你可以大大缩短路径。

You could use subst to name the two subdirectories your working from with drive letters. Obviously the are not real, but logical drives then, but you could substantially shorten the paths.

LASTDRIVE=Z
SUBST S: c:\this is a very long path name\source
SUBST T: d:\this is a very long path name\Target
#do whatever you need to, like
copy s:\filename T:\filename
SUBST S: /D
SUBST T: /D

/ D参数释放关联。

The /D parameter frees the association.

这篇关于cmd.exe命令行字符串限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆