使用位于网络驱动器上的 TCL 应用程序打开 Web URL
我刚刚完成了一个 TCL Db 应用程序,其中包含打开网页 URL 的功能。我的代码如下($adr 是 url):
eval exec [auto_execok start] \"\" [list $adr]
这段代码在我的 Windows 工作站上运行良好。但是,将应用程序放置在网络驱动器上后,我收到以下错误:
“\Drive\Share\Folder\Subfolder” CMD.EXE 以上述路径作为当前目录启动。 不支持 UNC 路径。默认为 Windows 目录。
网页仍然打开,但我仍然收到 TCl 错误。
有人知道在服务器或网络环境中使用 TCL 打开 URL 的更好方法吗?
谢谢你,
东风公司
I just finished a TCL Db App that includes a featrue to open web page URLs. My code is as follows ($adr is the url):
eval exec [auto_execok start] \"\" [list $adr]
This code works fine on my Windows workstation. However, after I placed the app on a network drive I receive the following error:
'\Drive\Share\Folder\Subfolder'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
The web page still opens, but I still get the TCl error.
Does soemone know a better way to open URLs with TCL in a server or network environment?
Thank you,
DFM
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当 Tcl 尝试执行您指定的 URL 时,显示的消息实际上是由 Windows 命令解释器 CMD.EXE 生成的。当它以设置为网络路径的当前工作目录启动时,它会向 stderr 生成该警告消息。
您可以尝试的另外两件事:
<预> cd $::env(TEMP)
eval exec [auto_execok start] \"\" [list $adr]
当然,请小心运行来自不受信任输入的任意命令和参数,否则有人可能会使用您的应用程序作为后门来运行恶意命令。
The message displayed is actually being generated by CMD.EXE, the Windows command interpreter, when Tcl tries to execute the URL that you specify. It generates that warning message to stderr when it is started with a current working directory that is set to a network path.
Two other things you could have tried:
Of course, be careful about running arbitrary commands and arguments that come from untrusted inputs, or someone might use your application as a backdoor to run malicious commands.