可以在批处理文件中设置像〜/ ....这样的目录 [英] is any way to set directory like ~/.... in batch file

查看:79
本文介绍了可以在批处理文件中设置像〜/ ....这样的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置dir = C:\ Users \ sree \Desktop \ sivaTempFile 





但是我想要这样



设置dir =〜\Desktop\sivaTempFile 

解决方案

否。

〜语法仅用于IIS(和类似的Web托管软件)作为当前Web应用程序的根目录。在IIS之外不可用。



您可以通过从您的网站内部编写batc文件并在其中使用〜来为每个系统创建适当的批处理文件:



  string  setRoot =  string  .Format(  SET ROOTDIR = \{0} \\ n ,Server.MapPath( )); 


Set dir=C:\Users\sree\Desktop\sivaTempFile



But i want like this

Set dir=~\Desktop\sivaTempFile

解决方案

No.
"~" syntax is only used with IIS (and similar web hosting software) as the root directory of the current web application. It is not available outside IIS.

You can always create the batch file appropriately for each system by writing the batc file from inside you website, and using "~" there:

string setRoot = string.Format("SET ROOTDIR=\"{0}\"\n", Server.MapPath("~"));


这篇关于可以在批处理文件中设置像〜/ ....这样的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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