使用plsql获取桌面的完整路径
我正在尝试使用 plsql 脚本获取服务器桌面的完整路径。在服务器本身上运行脚本。
plsql 内部似乎没有方法来检索它。无论在哪台计算机/服务器上,我都需要将脚本的输出假脱机到桌面。因此,其他计算机上的用户名和桌面路径可能不同。
编辑: 目前正在尝试: dbms_system.get_env('用户配置文件', 桌面);
我可以获取桌面的路径,但它不是当前用户的路径。我得到的是 C:\Documents and Settings\Default User\Desktop
也尝试过: SQL> host echo %username%
Administrator
最终我需要的路径是 C:\Documents and Settings\Administrator\Desktop 但用户名不能被硬编码......
I'm trying to obtain the full path of the server's desktop using a plsql script. running the script on the server itself.
There seems to be no methods inside plsql to retrieve it. I need to spool the output of my script to the desktop no matter on which computer/server. So the username and desktop path can be different on other machines.
EDIT:
Currently trying:
dbms_system.get_env('userprofile', desktop);
I can get the path of the desktop but it is not the current user's one. What i get is C:\Documents and Settings\Default User\Desktop
Also have tried:
SQL> host echo %username%
Administrator
Ultimately the path i need is i.e. C:\Documents and Settings\Administrator\Desktop
but the username cannot be hardcoded...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,服务器无法直接写入客户端的桌面/文件系统。客户端软件从服务器请求数据流,然后客户端可以将其写入屏幕、文件......
如果客户端软件不合作,我会考虑将结果通过电子邮件发送给用户。
[您可以使用 SYS_CONTEXT 和 USERENV 获取客户端的 OS_USER 和 IP,但这可能没有用,如果它们来自应用程序服务器,则绝对没有用。]
Generally a server can't write directly to a client's desktop / filesystem. The client software requests a stream of data from the server and then the client may write it to the screen, a file....
If the client software isn't being co-operative, I'd look at emailing the results to the user.
[You can get the OS_USER and IP of the client using SYS_CONTEXT and USERENV, but that probably isn't useful, and definitely not if they have come through an app-server.]