运行 来自 Windows Task Scheduler 的 accessDb 2016 Makro
Running an accessDb 2016 Makro from Windows Task Scheduler
我有一个 AccessDB 宏,我想从 windows 任务调度程序 运行 访问需要访问用户 运行 正在执行任务的映射网络驱动器。
经过一些初步的麻烦后,我发现,自从访问 2016 年以来,当访问数据库作为后台进程执行时,宏将不会 运行。所以我将计划任务的类型切换为Windows 2003/XP,它仍然在前台执行任务。
这个问题显然是,使用这种类型的任务,网络连接不再可用。
有没有办法 运行 Windows 2003/XP 类型的任务,同时仍然保留执行任务的用户的映射网络驱动器和网络连接?
我通过
启动宏
"path/to/msaccess.exe" "path/to/db.accdb" /X RunMacro
可能是SMB网络协议引起的
Windows XP 不知道 SMB2/3,而 Windows 10 默认情况下不会激活 SMB1,因为存在潜在的安全风险。
不过,在Windows10(功能select)中激活SMB1很简单。因此,如果您可以忍受这种安全风险,您可以尝试激活 SMB1 协议,看看这是否会有所作为。如果没有,可以轻松将其停用。
Windows 任务调度程序不是最佳解决方案。微软声明如下:
All current versions of Microsoft Office were designed, tested, and configured to run as end-user products on a client workstation. They assume an interactive desktop and user profile. They do not provide the level of reentrancy or security that is necessary to meet the needs of server-side components that are designed to run unattended.
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution.
在 Considerations for server-side Automation of Office 文章中阅读更多相关信息。
我有一个 AccessDB 宏,我想从 windows 任务调度程序 运行 访问需要访问用户 运行 正在执行任务的映射网络驱动器。
经过一些初步的麻烦后,我发现,自从访问 2016 年以来,当访问数据库作为后台进程执行时,宏将不会 运行。所以我将计划任务的类型切换为Windows 2003/XP,它仍然在前台执行任务。
这个问题显然是,使用这种类型的任务,网络连接不再可用。
有没有办法 运行 Windows 2003/XP 类型的任务,同时仍然保留执行任务的用户的映射网络驱动器和网络连接?
我通过
启动宏"path/to/msaccess.exe" "path/to/db.accdb" /X RunMacro
可能是SMB网络协议引起的
Windows XP 不知道 SMB2/3,而 Windows 10 默认情况下不会激活 SMB1,因为存在潜在的安全风险。
不过,在Windows10(功能select)中激活SMB1很简单。因此,如果您可以忍受这种安全风险,您可以尝试激活 SMB1 协议,看看这是否会有所作为。如果没有,可以轻松将其停用。
Windows 任务调度程序不是最佳解决方案。微软声明如下:
All current versions of Microsoft Office were designed, tested, and configured to run as end-user products on a client workstation. They assume an interactive desktop and user profile. They do not provide the level of reentrancy or security that is necessary to meet the needs of server-side components that are designed to run unattended.
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution.
在 Considerations for server-side Automation of Office 文章中阅读更多相关信息。