Jump to content

System Locked


neby
 Share

Recommended Posts

Hello,

I am using AutoIt to script file transfers during the middle of the night. Due to system security; however, the system must be locked when not in use. I have done tests with my script and I know the script works fine; however, when the system is locked, the script will not work.

I have tried to search the forums and I can not find anything that has resolved my issue. I don't think a service will work because I must use 10-15 different scripts. The script launches an SFTP application, Authenticates via cert and then executes the proper gets/puts for that time.

Can anyone help me get this script to run even while the system is locked?

Link to comment
Share on other sites

Hello,

I am using AutoIt to script file transfers during the middle of the night. Due to system security; however, the system must be locked when not in use. I have done tests with my script and I know the script works fine; however, when the system is locked, the script will not work.

I have tried to search the forums and I can not find anything that has resolved my issue. I don't think a service will work because I must use 10-15 different scripts. The script launches an SFTP application, Authenticates via cert and then executes the proper gets/puts for that time.

Can anyone help me get this script to run even while the system is locked?

When you say the script doesn't work, what exactly do you mean?

1. Do you mean the script itself just stops?

2. Do you mean that some of the functionality that the script tries to do doesn't work.

Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Link to comment
Share on other sites

Full Code

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.12.1
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------
$logname = "LOG_" & @YEAR & "-" & @MON & "-" & @MDAY & "-" & @HOUR & @MIN & ".LOG"

; Script Start -  Close Old Open Apps incase of errors
WinActivate( "Connect to FTP Site" )
ControlCLick( "Connect to FTP Site", "", "[CLASS:Button; INSTANCE:2]")
WinActivate( "Reflection SFTP Client - Settings.rfw" )
WinKill ( "Reflection SFTP Client - Settings.rfw" )
Sleep(5000)
WinActivate( "Connect to FTP Site" )
ControlCLick( "Connect to FTP Site", "", "[CLASS:Button; INSTANCE:2]")
WinActivate( "Reflection SFTP Client - Settings.rfw" )
WinKill ( "Reflection SFTP Client - Settings.rfw" )
Sleep(5000)
run ( "rsftpc.exe")

; Connect to Host
Sleep(2000)
WinWait("Connect to FTP Site", "", 1000)
ControlCLick( "Connect to FTP Site", "", "[CLASS:Button; INSTANCE:1]")

; Cert Authentication
WinWait("Reflection Secure Shell", "", 1000)
ControlCLick( "Reflection Secure Shell", "", "[CLASS:Button; INSTANCE:1]")
WinWait("Signing data with your private exchange key!", "", 1000)
ControlCLick( "Signing data with your private exchange key!", "", "[CLASS:Button; INSTANCE:2]")
WinWait("Signing data with your private exchange key!", "", 1000)
ControlCLick( "Signing data with your private exchange key!", "", "[CLASS:Button; INSTANCE:2]")

; Start Logging
Sleep(10000)
WinActivate( "Reflection SFTP Client - Settings.rfw" )
Send("!t")
Send("l")
WinWait("Start Logging", "", 1000)
Send("C:\SFTPLogs\")
Send($logname)
Send("{Enter}")

; Script Launch
Sleep(2000)
WinActivate( "trim07 - Reflection SFTP Client - Settings.rfw" )
Send("!s")
Send("s")
WinWait("Run Script", "", 1000)
Send("D:\Inetpub\ftproot\ibmftp\Trim07\test.rfs")
Send("{Enter}")

; Stop Logging, Close Application
WinWait("Connect to FTP Site", "", 1000)
ControlCLick( "Connect to FTP Site", "", "[CLASS:Button; INSTANCE:2]")
Sleep(5000)
Send("!t")
Send("l")
Sleep(5000)
WinKill ( "Reflection SFTP Client - Settings.rfw" )

Now, the issue that I am running into. The AutoIt script will start; however, it will not be able to run through the whole thing, because it can not do the Control Clicks (i guess).

The reason I am doing this, is because I have different files i need to get and/or put at different time. I use a different AutoIt file to launch different scripts and use task scheduler to launch the script at the time it needs to run.

Link to comment
Share on other sites

Your script relies on windows being active, thus you have to be logged in to have it run. You may want to see if the application you are working with has command line support. If it does, you can run it like that with the task scheduler.

Edited by Volly
Link to comment
Share on other sites

Nope, you can't simulate that. Windows security will stop you on that one. It is best to check the command line route first. If that doesn't work, you can look in example scripts to see the FTP sticky to make a new script that doesn't rely on mouse clicks. That may be a way around the problem.

Link to comment
Share on other sites

Didn't think of that. Nice catch!

Thanks - I should add that of the two links that I posted [MS vs. Sun] Sun's VirtualBox VM allows for greater customization of the interaction between the host and the VM (i.e. you can allow a mapped drive back to the host hard drive, but disable clipboard sharing with the host); however, the mapped drive feature is a bit buggy right now.

And, anyone using a VM for a very specific purpose (like the OP could do) might want to consider removing as many OS components from the VM as possible to make it operate with fewer resources from the host OS. i.e. remove WMI, IE, games, ... Things that nLite can help you strip out. People claim to have XP installed using only a few hundred MBs of hard drive space. http://www.mp3car.com/vbulletin/331469-post7.html

@Zedna,

You have answered this "Locked" question a few times :-)

*How about a FAQ post to this thread:

http://www.autoitscript.com/forum/index.php?showtopic=37289

*Notice that I did not volunteer... :-)

... since you are so much more learned and articulate than I.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

@Zedna,

You have answered this "Locked" question a few times :-)

*How about a FAQ post to this thread:

http://www.autoitscript.com/forum/index.php?showtopic=37289

*Notice that I did not volunteer... :-)

... since you are so much more learned and articulate than I.

Good tip :-)

I will add it there.

EDIT: added

Edited by Zedna
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...