Sign in to follow this  
Followers 0
A_Noobie_User

Running a Script as a Screensaver

12 posts in this topic

Is there a way to run a program as a screen saver? Let me explain, I have a roommate that likes to "snoop" on my machine when Im not here. I have found a program that will hide "folders". What I want to do is when the screensaver executes, I want the program to launch that hides my folders. That way the folders are hidden, and my roommate cant snoop.

I can not claim to be good with autoit as of yet. I came real close to making this work a few weeks ago. The problem is this: When the screen saver kicks in, all I get is a black screen. Nothing happens. I am hoping some of you pro's out there will have a clue to pass on.

The program that hides folders requires a switch, "app.exe /hide".

If any of you peeps could give me an idea of what to to do, I would be most happy. I have been searching google for the last three hours, and I cant stand looking at the screen anymore.

Thanx for ant help reagarding this issue,

A_Noobie_User

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Get WinXP installed, create seperate accounts and put security on the privat directories... a screen saver is not going to do much for you... :)

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Get WinXP installed, create seperate accounts and put security on the privat directories...  a screen saver is not going to do much for you...  :)

<{POST_SNAPBACK}>

Just to be precice, WinXP Professional; not the Home version. XP Home don't have the "Security" tab in folder settings.

In other case, you might want to use a Windows screensaver with the "password" setting enabled. It' s a too basic security level but it might work in your case.

An alternative could be a good program for hiding folders/setting permissions, called Universal Shield. You might want to try it out.

Apart from these, you cannot execute an (AutoIT) program as a screensaver. There are several screensavers that allow you to call an .EXE when they are activated, but a Windows screensaver is not in executable file format (it is .SCR actually).

What you may also want to try out, is to create a script that disables the Windows screen saver and behaves itself as a screen saver (waiting for the screen and input controls to be idle for a period of time and then activates a function or something...).

Hope these help, good luck.

Share this post


Link to post
Share on other sites

Just to be precice, WinXP Professional; not the Home version. XP Home don't have the "Security" tab in folder settings.

<{POST_SNAPBACK}>

Question: I am a XP prof user, but is this always the case in XP Home or only when you didn't convert your disk to NTFS ?

Apart from these, you cannot execute an (AutoIT) program as a screensaver. There are several screensavers that allow you to call an .EXE when they are activated, but a Windows screensaver is not in executable file format (it is .SCR actually).

<{POST_SNAPBACK}>

Windows screen savers actually are normal programs renamed to SCR, the only thing you need to do is to enable it to "Listen" to the different commands to ensure that it will start/stop when needed...

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

If you just want a secret folder, try this. Compile it. Name it to what you want, as you will call it from the run box, by that name. First time run. It will copy itself to system32 dir, and delete it's original executable. The, when you run it from runbox, it will ask for a password. Pick one that you can remember. Following uses will ask for a password before opening this hidden folder. Tested to work on XP. Nothing super secure. Just simple hide and seek.

Opt("TrayIconHide", 1)

Dim $name = StringTrimRight(@ScriptName, 4)
Dim $path = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\'
Dim $sd = EnvGet('systemdrive')
Dim $read, $cmdfile, $pw, $fail, $first

; Create the directory.
If Not FileExists($sd & '\' & $name) Then DirCreate($sd & '\' & $name)

; Change directory to hidden.
Run(@ComSpec & ' /c attrib +H ' & $sd & '\' & $name, '', @SW_HIDE)

; Insert exe into systemdir.
If Not FileExists(@SystemDir & '\' & @ScriptName) Then FileCopy(@ScriptName, @SystemDir)

; Password written to ini file, on first use.
If Not FileExists(@AppDataDir & '\Secret Folder') Then
   DirCreate(@AppDataDir & '\Secret Folder')
   $first = InputBox('Security Measure', 'Please enter the password' & @CRLF & 'you will use for future use', '', '', 170, 140)
   IniWrite(@AppDataDir & '\Secret Folder\Data.ini', 'Information', 'Password', $first)
   Sleep(1000)
   Run(@ComSpec & ' /c attrib +H "' & @AppDataDir & '\Secret Folder"', '', @SW_HIDE)
EndIf

; Read password from ini file.
$read = IniRead(@AppDataDir & '\Secret Folder\Data.ini', 'Information', 'Password', 'Not Found')

Sleep(500)

; Insert exe location into registry.
RegWrite($path & @ScriptName, '', 'reg_sz', @SystemDir & '\' & @ScriptName)
RegWrite($path & @ScriptName, 'Path', 'reg_sz', @SystemDir)

Sleep(500)

Password()

; Is file in system directory, if exists, then ask for password.
Func Password()
   If @ScriptFullPath = @SystemDir & '\' & @ScriptName Then
      $pw = InputBox('Security Check', 'Enter your password please', '', '*', 170, 125)
      If $pw = $read Then
         Run(@ComSpec & ' /c explorer ' & $sd & '\' & $name, '', @SW_HIDE)
      ElseIf $pw = 'source' Then
         FileInstall('c:\hide.au3', $sd & '\' & $name & '\' & $name & '.au3')
         Sleep(1000)
         Password()
      Else
         Sleep(1000)
         $fail = MsgBox(5, 'Security Check', 'You entered the wrong password', 10)
         If $fail = 4 Then
            Password()
         Else
            Exit
         EndIf
      EndIf
   Else
      Delete()
   EndIf
EndFunc  ;==>Password

; Self-delete the original exe file.
Func Delete()
   FileDelete(@TempDir & "\scratch.cmd")
   $cmdfile = ':loop' & @CRLF & 'del "' & @ScriptFullPath & '"' & @CRLF & 'if exist "' & @ScriptFullPath & _
         '" goto loop' & @CRLF & 'del ' & @TempDir & '\scratch.cmd' & @CRLF
   FileWrite(@TempDir & "\scratch.cmd", $cmdfile)
   Run(@TempDir & "\scratch.cmd", @TempDir, @SW_HIDE)
EndFunc  ;==>Delete

Share this post


Link to post
Share on other sites

Question: I am a XP prof user, but is this always the case in XP Home or only when you didn't convert your disk to NTFS ?

It's a little bit tricky because of Microsoft's marketing...

An NTFS volume always has the option to accept security flags to every file/folder on it (independently of the OS you use). With XP Pro you can set them to whatever you want (because of the security tab I mentioned above). XP home don't have this security tab (even if you are logged in as admin), however they support NTFS volumes. You cannot change anything manually with XP home, the only thing they do automatically is set the user permissions depending on the user who has logged in. In this way the normal users cannot read the data that other normal users have written and so on. The admin can read anything but cannot change file/folder permissions...

It sucks, I know.. :)

Windows screen savers actually are normal programs renamed to SCR, the only thing you need to do is to enable it to "Listen" to the different commands to ensure that it will start/stop when needed...

<{POST_SNAPBACK}>

Thanks JdeB, I had no idea of this.. Good to know.. :)

Share this post


Link to post
Share on other sites

XP home don't have this security tab (even if you are logged in as admin), however they support NTFS volumes. You cannot change anything manually with XP home

XP Home doesn't have the security tab. But it still supports all security options. You have to use the command line (cacls.exe or xcacls.exe).

Except joining a domain WinXP Home supports everything WinXP Prof does. Microsoft only removed the GUIs for some things.

Share this post


Link to post
Share on other sites

You could try the free program Screen Launcher which is supposed to do exactly what you want...

<{POST_SNAPBACK}>

CyberSlug you are the man!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Much thnx to your link to that file. It works just like I have dreamed. There are not enough ways to thank you for that. I have spent months reading, and googling. In one tiny (free) program you have solved that. Thanx again.

I also want to thank all the peeps that answered this post. Thank you for your time, and effort.

Till another post,

A_Noobie_User

Share this post


Link to post
Share on other sites

XP Home doesn't have the security tab. But it still supports all security options. You have to use the command line (cacls.exe or xcacls.exe).

Except joining a domain WinXP Home supports everything WinXP Prof does. Microsoft only removed the GUIs for some things.

<{POST_SNAPBACK}>

You are very right, however I was talking for the "default" Windows' behaviour... An NTFS volume is OS independent as I said so an external tool always can do the job.

And to be totally accurate, cacls.exe is included in the default XP home installation and xcacls.exe is installed by the Windows Support Tools.

Share this post


Link to post
Share on other sites

And to be totally accurate [...]

Perfect :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0