Jump to content

Need to run script in background(user should not see what is running)


Recommended Posts

Hi All,

I am trying some script to run in back group (should not be visible).. For example, if i open notepad and type something and save it on desktop.. all these activities should not be shown to user. I went through some blogs and got better idea. But while running the script, am seeing SAVE AS window is visible for few seconds..

Please let me know is there a way to hide that SAVE AS window too? Appreciate your help..

Other question i have is, while running this script, I want to work on other task (any task, like email or word document or music any task) .. is that possible or do i need to wait and dont use keyboard / mouse till the script executed fully? 

 

#notrayicon
Opt("WinTitleMatchMode", 2)

; Remove Test file
$filenamepath = 'C:\Users\varikutv\Desktop\test.txt'
FileDelete($filenamepath)


; Launch Notepad and Enter some text
Run("notepad", "", @SW_HIDE)
ProcessWait("notepad.exe")
ControlSend("Notepad", "", "Edit1", "Hello created file")

; Save as $filenamepath
WinMenuSelectItem("Notepad", "", "&File", "Save &As...")
WinWait("Save As", "")
WinSetState("Save As","",@SW_HIDE)
ControlSetText("Save As", "", "Edit1", $filenamepath)
ControlSend("Save As","","","{TAB}")
ControlSend("Save As","","","{TAB}")
ControlSend("Save As","","","{TAB}")
ControlSend("Save As","","","{TAB}")
ControlSend("Save As","","","{SPACE}")

Link to comment
Share on other sites

  • Moderators

viswat88,

all these activities should not be shown to user

And just why do you want to hide this activity from the user?

M23 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

 

When you see a MOD has replied with a question for the OP, and not given a solution, don't take it upon yourself to then give one.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

  • Moderators

ahmeddzcom,

As TheSaint has pointed out, we take a very dim view of people providing help when a Mod is awaiting some clarity on the question posed. Please do not do it again.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

@Melba23 -

This example here (for notepad) is just to understand the concept and run the application in hide mode (user should not see whats happening)

Also, when you are running in hide mode, it is not good to see SAVE AS window or other windows. My main interest is, once i got the concept, i will use it on various systems as an admin to install required applications through exe file based on the tickets /user requirements.. (for example - user need access to some X system, i need to change IP address and hit some commands to get access, so i can do this on user system but i dont want them to know what am doing or the commands what i use)

Please let me know how to hide all such intermediate windows when running script in hide mode.. Thanks..

 

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