我正在通过《Learn python the Hard way》一书学习Python编程。因此我使用 powershell 来运行我的程序。由于每次启动 powershell 时都必须手动更改目录,因此我编写了一个批处理文件来自动化它。
我写的命令是:
powershell.exe -noexit -command "'cd c:\self\pooja\"edu n career"\programs\python'"
Run Code Online (Sandbox Code Playgroud)
问题是它运行但仅打开“程序”目录。为什么它没有更改为 python 目录?
最后,我通过在 powershell 的快捷方式属性中设置“开始于”字段来完成此操作,但我想知道为什么批处理文件没有按预期工作。