我的当前目录是“C:\devel\test\”
我想运行类似的东西command -m 'pwd'\data\test.xml
,它就像我进入了command -m C:\devel\test\data\test.xml
如果我正在编写脚本,我会:
$pwd = pwd
command -m $pwd\data\test.xml
但不确定如何在提示下执行此操作。
更新
这可能是 IronPython 问题。使用下面建议的命令azhreiipy -m ($pwd.path + "\data\test.xml")
我收到以下错误:
Unhandled exception:
Traceback (most recent call last):
File "C:\Program Files (x86)\IronPython 2.7\Lib\runpy.py", line 101, in _get_module_details
File "C:\Program Files (x86)\IronPython 2.7\Lib\runpy.py", line 170, in run_module
File "C:\Program Files (x86)\IronPython 2.7\Lib\pkgutil.py", line 456, in get_loader
File "C:\Program Files (x86)\IronPython 2.7\Lib\pkgutil.py", line 466, in find_loader
File "C:\Program Files (x86)\IronPython 2.7\Lib\pkgutil.py", line 422, in iter_importers
ImportError: Import by filename is not supported.
当我运行ipy -m C:\devel\test\data\test.xml
它工作得很好。