Sign in to follow this  
Followers 0
Bert

concept question

7 posts in this topic

I have to locate about 350 PCs in my building. The building is 25 stories, and the IPS are segmented by floor. WHat I would like to do for those PCs I have a hard time finding is make a program that makes the PC "make noise". I would change the wallpaper (or splash screen) to red, and have the PC speaker beep every so often. That way when I walk the floor, I can find it rather quickly. Making it should be pretty strait forward, but I did think of one problem.

If the PC isn't logged in, how do I get the script to start? Let me put this another way. If I use a splash screen for the red bit, can I run a script that has this while the PC isn't logged in, (and have it work?) I have a method of installing software if the PC isn't logged on but the other thing has me puzzled. Thoughts?

Share this post


Link to post
Share on other sites



erm, why don't you implement a proper naming scheme for your PCs and implement DNS and DHCP (with dynamic DNS updates), so you can always figure out which IP address belongs to which PC (identified by the specific name). So, you don't have to SEARCH the PCs, you just KNOW where they are...

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

To answer you question:

If the PC isn't logged in, how do I get the script to start? Let me put this another way. If I use a splash screen for the red bit, can I run a script that has this while the PC isn't logged in, (and have it work?) I have a method of installing software if the PC isn't logged on but the other thing has me puzzled. Thoughts?

One of the things you might want to consider is intalling a piece of software that runs as a service. A service set to run under the local system account would run without anybody logged in.

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@/dev/null: The naming scheme is the SN of the PC. I can get it down to a floor, but where it is on the floor is another matter. Also the nameing scheme is not something I have any control over. I'm simply trying to find the stray PC that may be hard to find.

@PaulIA: I can get it to run as a service, but I would first have to load it on the PC in question, then start the service. I can't have it installed on the PCs ahead of time and use when I need. (Not allowed to do that).

No offence, (I'm not trying to be rude here) but neither one of the points you 2 bring up addresses the question I have. I need to run the script as a service, and have it do things like put up a splashscreen and beep while the PC is not logged in. Is this possible? I have never heard of anyone attempting this

Edited by vollyman

Share this post


Link to post
Share on other sites

No offence, (I'm not trying to be rude here) but neither one of the points you 2 bring up addresses the question I have. I need to run the script as a service, and have it do things like put up a splashscreen and beep while the PC is not logged in. Is this possible? I have never heard of anyone attempting this

Actually, if you look at your first post, you will see that I addressed your question. You asked how to get the program to start without being logged in first. I told you that you can run it as a service, which doesn't require to log on. You don't have to have it loaded ahead of time. Load it when you need it and then run another program to remove it from the machines when you're done.

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

No offence, (I'm not trying to be rude here) but neither one of the points you 2 bring up addresses the question I have. I need to run the script as a service, and have it do things like put up a splashscreen and beep while the PC is not logged in. Is this possible? I have never heard of anyone attempting this

O.K. let's take a look at the splash screen thing. If nobody is logged in, then it is likely that either the log-on screen is shown or a screen saver. In both cases it would be hard (impossible) to view a splash screen. AND a splash screen won't help you if the monitor is turned off, which is quite likely if there is nobody logged in.

Regarding the sound thing. You can surely play a sound on a remote computer if you are able to execute a program on that computer, either as a service (which you are not allowed, which in turn makes me wonder). Alternatively you can use PsExec form Sysinternals.com. However, you will need admin rights for that, which you might not have if you are not allowed to install a service.

Anyway, now you have all information to accomplish your task.

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Well, what I came up with will work fine, for I realized that if I could get to the PC to start the service, I could just as well log into it remotely, then start the program. With that in mind, it would keep things much simpler. I came up with this:

(If someone wishes to improve the idea, by all means!)

Opt("TrayIconHide", 1)
;Opt("TrayIconDebug", 1)
#include <GuiConstants.au3>
#include <inet.au3>
Dim $voice = ObjCreate("Sapi.SpVoice")
HotKeySet("^!c", "_exit")
Dim $chk_1, $chk_2, $chk_3, $chk_4, $chk_5, $chk_6, $voice
$gui1 = GUICreate("PCBeacon 1.0", 392, 323, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Checkbox_1 = GUICtrlCreateCheckbox("Flashing screen", 20, 20, 120, 20)
$Checkbox_2 = GUICtrlCreateCheckbox("Audio", 20, 60, 120, 20)
$Checkbox_3 = GUICtrlCreateCheckbox("Message to show", 20, 100, 120, 30)
$Input_4 = GUICtrlCreateInput("", 20, 150, 350, 80)
$Button_5 = GUICtrlCreateButton("Start", 60, 260, 70, 30)
$Button_6 = GUICtrlCreateButton("Exit", 160, 260, 70, 30)
$radio_7 = GUICtrlCreateRadio("Talk", 220, 60, 50, 20)
$radio_8 = GUICtrlCreateRadio("beep", 280, 60, 50, 20)
$group_9 = GUICtrlCreateGroup("", 200, 50, 150, 35)
$lable_10 = GUICtrlCreateLabel("PCBeacon 1.0" & @CRLF & "CTS Richmond HDQ" & @CRLF & "November 2006", 260, 260, 120, 90)
GUICtrlSetData($Input_4, IniRead("PCB.inr", "text", "text", ""))
GUICtrlSetState($Checkbox_3, $GUI_DISABLE)
GUICtrlSetState($Input_4, $GUI_DISABLE)
GUICtrlSetState($radio_7, $GUI_DISABLE)
GUICtrlSetState($radio_8, $GUI_DISABLE)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Checkbox_1
            $a = GUICtrlRead($Checkbox_1)
            If $a = $GUI_CHECKED Then
                GUICtrlSetState($Checkbox_3, $GUI_ENABLE)
                GUICtrlSetState($Input_4, $GUI_ENABLE)
            EndIf
            If $a = $GUI_UNCHECKED Then
                GUICtrlSetState($Checkbox_3, $GUI_DISABLE)
                GUICtrlSetState($Input_4, $GUI_DISABLE)
            EndIf
        Case $msg = $Checkbox_2
            $b = GUICtrlRead($Checkbox_2)
            If $b = $GUI_CHECKED Then
                GUICtrlSetState($radio_7, $GUI_ENABLE)
                GUICtrlSetState($radio_8, $GUI_ENABLE)
            EndIf
            If $b = $GUI_UNCHECKED Then
                GUICtrlSetState($radio_7, $GUI_DISABLE)
                GUICtrlSetState($radio_8, $GUI_DISABLE)
            EndIf
        Case $msg = $radio_7
            $c = GUICtrlRead($radio_7)
            $cc = GUICtrlRead($Checkbox_2)
            Select
                Case $c = $GUI_CHECKED
                    GUICtrlSetState($Input_4, $GUI_ENABLE)
                Case $c = $GUI_UNCHECKED
                    GUICtrlSetState($Input_4, $GUI_DISABLE)
                Case $cc = $GUI_UNCHECKED
                    GUICtrlSetState($Input_4, $GUI_DISABLE)
            EndSelect
        Case $msg = $radio_8
            $d = GUICtrlRead($radio_7)
            Select
                Case $d = $GUI_CHECKED
                    GUICtrlSetState($Input_4, $GUI_DISABLE)
                Case $d = $GUI_UNCHECKED
                    GUICtrlSetState($Input_4, $GUI_DISABLE)
                    
            EndSelect
            
        Case $msg = $Button_5 ;start
            MsgBox(0, "Important!", 'Once started, you will need to use "CTRL + ALT + C" to end the program')
            _start()
        Case $msg = $Button_6 ;start
            Exit
        Case Else
            ;;;
    EndSelect
WEnd
Exit

Func _exit()
    Exit
EndFunc   ;==>_exit

Func _start()
    Local $splash
    $chk_1 = GUICtrlRead($Checkbox_1) ;splash
    $chk_2 = GUICtrlRead($Checkbox_2) ;beep
    $chk_3 = GUICtrlRead($Checkbox_3) ;message
    $chk_4 = GUICtrlRead($Input_4)
    IniWrite("PCB.inr", "text", "text", $chk_4)
    $chk_5 = GUICtrlRead($radio_7) ;splash
    $chk_6 = GUICtrlRead($radio_8)
    GUISetState(@SW_HIDE, $gui1)
    If $chk_1 = $GUI_CHECKED Then _loop1()
    If $chk_2 = $GUI_CHECKED Then _loop2()
EndFunc   ;==>_start

Func _loop1()
    $gui2 = GUICreate("", 600, 500, -1, -1, "", 0x00000008)
    GUISetBkColor(0xE0FFFF, $gui2)
    $lable = GUICtrlCreateEdit("", 100, 25, 400, 400, 0x0004 + 0x0800 + 0x0001)
    If $chk_3 = $GUI_CHECKED Then
        $font = "Comic Sans MS"
        GUICtrlSetData($lable, $chk_4)
        GUICtrlSetFont($lable, 22, 900, "", $font)
    EndIf
    GUISetState(@SW_SHOW, $gui2)
    While 1
        $getpos = MouseGetPos()
        MouseMove($getpos[0] + 1, $getpos[1], 0)
        MouseMove($getpos[0] - 1, $getpos[1], 0)
        If $chk_2 = $GUI_CHECKED Then
            If $chk_5 = $GUI_CHECKED Then
                _Talk($chk_4, 0.75, 100)
                Sleep(2000)
            EndIf
            if  $chk_6 = $GUI_CHECKED Then Beep(500, 1000)
        Else
            Sleep(1000)
        EndIf
        SplashImageOn("", @ScriptDir & "\red.bmp", @DesktopWidth, @DesktopHeight)
        Sleep(1000)
        SplashOff()
    WEnd
EndFunc   ;==>_loop1

Func _loop2()
    While 1
        If $chk_5 = $GUI_CHECKED Then
            _Talk($chk_4, 0.75, 100)
            Sleep(2000)
        EndIf
        if  $chk_6 = $GUI_CHECKED Then
            Beep(300, 200)
            Beep(400, 500)
            Beep(500, 200)
            Beep(600, 500)
            Sleep(3000)
        EndIf
    WEnd
EndFunc   ;==>_loop2

Func _Talk($Text, $Rate, $Vol)
    $voice.Rate = $Rate
    $voice.Volume = $Vol
    $voice.Speak ($Text)
EndFunc   ;==>_Talk
Edited by vollyman

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