脚本在win7锁屏下无法执行

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: tmplinshi, arcticir

huangdxx
Posts: 1
Joined: 06 Aug 2014, 20:55

脚本在win7锁屏下无法执行

06 Aug 2014, 21:27

脚本如下
FormatTime,ss,,yyyyMMdd
Run,D:\share\AutoTestReport\%SS%\overview-summary.html
WinWait, SoapUI Test Results: Summary - Windows Internet Explorer,
IfWinNotActive, SoapUI Test Results: Summary - Windows Internet Explorer, , WinActivate, SoapUI Test Results: Summary - Windows Internet Explorer,
WinWaitActive, SoapUI Test Results: Summary - Windows Internet Explorer,
Send, {CTRLDOWN}a{CTRLUP}{CTRLDOWN}c{CTRLUP}
WinWait, ,
IfWinNotActive, , , WinActivate, ,
---------------------------------------------------------------------
在非锁屏情况下执行非常正常,锁屏情况下执行到Send, {CTRLDOWN}a{CTRLUP}{CTRLDOWN}c{CTRLUP}这句这前,脚本就停顿不继续执行,屏幕一但解锁,脚本又继续正常执行

有同学知道如何解决吗,脚本是要在凌晨定时执行的,电脑IT是强制自动锁屏的
User avatar
amnesiac
Posts: 186
Joined: 22 Nov 2013, 03:08
Location: Egret Island, China
Contact:

Re: 脚本在win7锁屏下无法执行

07 Aug 2014, 02:21

猜测是系统的安全性限制,手上没有 Win7 测试。
User avatar
RobertL
Posts: 546
Joined: 18 Jan 2014, 01:14
Location: China

Re: 脚本在win7锁屏下无法执行

08 Aug 2014, 06:26

猜测无权限,
有新进展欢迎分享,
我为人人,人人为己?
CHMike
Posts: 8
Joined: 16 Nov 2014, 16:44

Re: 脚本在win7锁屏下无法执行

22 Nov 2014, 20:05

Hi! I had ever asked the similar questions about running the scripts in window off mode. But there is no solution when you use "Send" command.
The "Send" command sends the key press to the current activated window. When you are in window screen protect mode, this activated window is not the window you want that is why your script just run till "Winwait" then keep waiting the window you specified.

I got the answer is to use DLL or COM to develop the programs. For some cases ,it can work. I refer your script you are checking the IE related window. you can refer this page to get some example:
http://ahkscript.org/boards/viewtopic.php?f=6&t=77

But for my case, I want to control SAP but I can not find COM/DCOM so I can not use this way.
Currently I write a small script to prevent this computer into screen off mode then it can run the scripts during the midnight.
User avatar
RobertL
Posts: 546
Joined: 18 Jan 2014, 01:14
Location: China

Re: 脚本在win7锁屏下无法执行

22 Nov 2014, 23:55

Yes, CHMike.
DLL/COM works in background, and send simulate user operates in foreground which can't work in window off (lock) mode..
But interface of DLL/COM need to be supported by provider of application.
Also thanks for the sharing of COM Object Reference.
我为人人,人人为己?
CHMike
Posts: 8
Joined: 16 Nov 2014, 16:44

Re: 脚本在win7锁屏下无法执行

26 Nov 2014, 04:26

Yes, that is why I can use DLL/COM to control SAP in screen off , becasue I cannot get their releated information for DLL/ com.

Return to “请求帮助”

Who is online

Users browsing this forum: No registered users and 15 guests