Python从特定文件夹运行文件,但无法从其他文件夹运行
我有一个VB脚本,我想用python27运行,当我将VBS放在桌面上时,它可以成功运行,但是当我将相同的文件复制到另一个文件夹并想从那里运行时,它不运行!这让我发疯,我无法理解逻辑,有人可以帮助我吗?
我在 64 位 win 7 上安装了 python 32 位,因为我需要一些仅适用于 32 位版本的 python 模块,而且我的 VBS 基于 32 位 DLL。
正确运行:
import os
os.system("C:\Users\OFFICE2\Desktop\TSATResultSaver.vbs")
不运行:
import os
os.system("C:\My Modules\TSATResultSaver.vbs")
I have a VB script which I want to run with python27, when I place my VBS in desktop it can be run successfully but when I copy the same file to another folder and want to run from there it doesn't run!! this is running me crazy, I can't understand the logic, can someone please help me?!
I have python 32bit installed on my 64bit win 7 because I need some python modules that are only available for 32bit version, also my VBS is based on 32bit DLL.
Runs correctly:
import os
os.system("C:\Users\OFFICE2\Desktop\TSATResultSaver.vbs")
Doesn't run:
import os
os.system("C:\My Modules\TSATResultSaver.vbs")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保这两个文件夹的权限相同。另外,我会尝试一个路径中没有空格的文件夹(第一个路径中没有空格,但“我的模块”包含空格。
Make sure permissions on those two folders are the same. Also, I would try a folder without a space in the path (there are no spaces in the first path, but "My Modules" contains a space.