Jump to content

another newbie ? Hideing process from end user


Snaven
 Share

Recommended Posts

there was a topic about that, and answer was that you cant remove it from processlist, but you can rename it to windows application or something.

I hope that helps!

If I write a script to automate a process I just don't want the end user to see all these windows poping up. By saying process list are you refering to the tab under task manager?

Link to comment
Share on other sites

what type of script are you writing

purpose....????

8)

Okay this is the long story. My HR director came to me the other day and asked if I could automate a process for him. Out of the close to 300 policies we have there are 8 that we use verbatim from our corporate office. These are locate on a http download. These are changed very frequently. I need a script that will go in each day get the file on the site and replace the file we have currently on our servers. We have and in house web page that points to all of our policies and procedures. I don't want him to see all these screens popping up as he is sitting at his computer.

Link to comment
Share on other sites

are you planning on haveing a "user interface" to push a button to connect to that site???

does the actual download contain the correct text for you to use

and is it/they a text file???

8)

this is my plan.

I want to loop it for every 24 hrs

it will go out to the link, which starts the download of the file (.doc format) and then overwrite the doc stored on our server.

Link to comment
Share on other sites

...Out of the close to 300 policies we have there are 8 that we use verbatim from our corporate office. These are locate on a http download. These are changed very frequently. I need a script that will go in each day get the file on the site and replace the file we have currently on our servers...

I'm not clear if you want all 300 files copied each day or just the 8 used verbatim.

Take a look at "InetGet" in the help file.

Edited by herewasplato

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

Link to comment
Share on other sites

maybe this

****** NOT TESTED ***********

#include <GUIConstants.au3>

$Hour = "12"; based on 24 hour clock - 00 to 23
$Min = "30"; based on 60 minutes
$Web_site = "put your web path here"
$File_location = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

While 1
    
    If @HOUR & @MIN = $Hour & $Min Then
        
        GUICreate("Download", 200, 200, 300, 100)
        $Download = GUICtrlCreateProgress(50, 160, 105, 20, $PBS_SMOOTH)
        GUICtrlCreateGroup("Status ", 20, 40, 170, 90)
        GUICtrlCreateLabel("Downloaded: ", 25, 65, 150, 45)
        GUISetState()
        $size = InetGetSize($Web_site)
        InetGet($Web_site, $File_location, 1, 1)
        GUICtrlCreateLabel("Size: " & $size, 25, 90, 100, 35)
        
        While @InetGetActive
            For $i = @InetGetBytesRead To $size
                GUICtrlCreateLabel(@InetGetBytesRead, 100, 65, 30, 35)
                $i_StatusPercent = (@InetGetBytesRead / $size * 100)
                GUICtrlCreateLabel(Round($i_StatusPercent) & "%", 70, 110, 25, 15, $SS_CENTER + $WS_EX_LAYERED)
                GUICtrlSetData($Download, $i_StatusPercent)
                Sleep(250)
            Next
        WEnd
        Sleep(1000 * 60); wait 1 minute as to not run again for 24 hours
    EndIf
    Sleep(50)
WEnd

this has a progress bar

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

this can download 8 seperate files... hidden from user

****** NOT TESTED ******

#include <GUIConstants.au3>

Dim $Hour = "12"; based on 24 hour clock - 00 to 23
Dim $Min = "30"; based on 60 minutes
Dim $Web_site_[9]
Dim $File_location_[9]
Dim $time_to_download = 0
Dim $x

; file #1
$Web_site_[1] = "put your web path here"
$File_location_[1] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

; file #2
$Web_site_[2] = "put your web path here"
$File_location_[2] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

; file #3
$Web_site_[3] = "put your web path here"
$File_location_[3] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

; file #4
$Web_site_[4] = "put your web path here"
$File_location_[4] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"


; file #5
$Web_site_[5] = "put your web path here"
$File_location_[5] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

; file #6
$Web_site_[6] = "put your web path here"
$File_location_[6] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

; file #7
$Web_site_[7] = "put your web path here"
$File_location_[7] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

; file #8
$Web_site_[8] = "put your web path here"
$File_location_[8] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"



While 1
    
    If @HOUR & @MIN = $Hour & $Min Then
        $time_to_download = 1
    EndIf
    
    If $time_to_download = 1 Then
        
        For $x = 1 to 8
            If @error then
                MsgBox(64,"Download Error #1","There was an error in dowloading the files   ")
                $time_to_download = 0
                ExitLoop
            EndIf
            
            InetGet($Web_site_[$x], $File_location_[$x], 1, 1)
            
            While @InetGetActive
                Sleep(250)
                If @error then
                MsgBox(64,"Download Error #2","There was an error in dowloading the files   ")
                $time_to_download = 0
                ExitLoop
                EndIf
            WEnd
        Next
        $time_to_download = 0
        Sleep(1000 * 60); wait 1 minute as to not run again for 24 hours
    EndIf
    Sleep(50)
WEnd

hope one of those help

8)

NEWHeader1.png

Link to comment
Share on other sites

this can download 8 seperate files... hidden from user

****** NOT TESTED ******

#include <GUIConstants.au3>

Dim $Hour = "12"; based on 24 hour clock - 00 to 23
Dim $Min = "30"; based on 60 minutes
Dim $Web_site_[9]
Dim $File_location_[9]
Dim $time_to_download = 0
Dim $x

; file #1
$Web_site_[1] = "put your web path here"
$File_location_[1] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

; file #2
$Web_site_[2] = "put your web path here"
$File_location_[2] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

; file #3
$Web_site_[3] = "put your web path here"
$File_location_[3] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

; file #4
$Web_site_[4] = "put your web path here"
$File_location_[4] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"
; file #5
$Web_site_[5] = "put your web path here"
$File_location_[5] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

; file #6
$Web_site_[6] = "put your web path here"
$File_location_[6] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

; file #7
$Web_site_[7] = "put your web path here"
$File_location_[7] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"

; file #8
$Web_site_[8] = "put your web path here"
$File_location_[8] = "put the location to download here"; example - @homedrive & "\Temp\temp.txt"
While 1
    
    If @HOUR & @MIN = $Hour & $Min Then
        $time_to_download = 1
    EndIf
    
    If $time_to_download = 1 Then
        
        For $x = 1 to 8
            If @error then
                MsgBox(64,"Download Error #1","There was an error in dowloading the files   ")
                $time_to_download = 0
                ExitLoop
            EndIf
            
            InetGet($Web_site_[$x], $File_location_[$x], 1, 1)
            
            While @InetGetActive
                Sleep(250)
                If @error then
                MsgBox(64,"Download Error #2","There was an error in dowloading the files   ")
                $time_to_download = 0
                ExitLoop
                EndIf
            WEnd
        Next
        $time_to_download = 0
        Sleep(1000 * 60); wait 1 minute as to not run again for 24 hours
    EndIf
    Sleep(50)
WEnd

hope one of those help

8)

thanks for your help. You took all my fun away. back to my original question. If the script is wrapped into a gui the user will not be able to see what is going on behind the scene.?.?

Link to comment
Share on other sites

InetGet("http://...","C:\....",1,0)
InetGet("http://...","C:\....",1,0)
InetGet("http://...","C:\....",1,0)
InetGet("http://...","C:\....",1,0)
InetGet("http://...","C:\....",1,0)
InetGet("http://...","C:\....",1,0)
InetGet("http://...","C:\....",1,0)
InetGet("http://...","C:\....",1,0)
you might want to add a little error checking and then just schedule it with Task Scheduler... also keep in mind that Valuater writes better code that I do - you might want to stick with him.

I've run a script like this for months with no problems and no additional error checking... but it is not a critical process............

Edited by herewasplato

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

Link to comment
Share on other sites

in the file you quoted

1

there is no GUI

2

there is no indication the script its running except

A An error occurs

B The tray icon does show

8)

Boy, now I'm really confused.

I did the tutorials included in autoit. (just downloaded yesterday) When those were done all the windows popped up and performed the tasks. (you could see what was going on)

I just wanted to know if you could perform the tasks without the windows popping up.

Evidently you can as you have shown.

Is it because your using processes inherit of autoit instead of calling notepad.exe as in the examples?

Link to comment
Share on other sites

  • Moderators

This post seemed to jump from one place to the other Made it seem like ya'll were talking in code about code :P... Are you looking for: @SW_HIDE?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Yea I was wondering when someone would post about @SW_HIDE until I saw about the third post where it was talked about downloading files.

That is what INetGet() is for. Read the helpfile. It will download the file in the background. All of that is explained in the helpfile.

Goodluck,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

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...