nobby 0 Posted September 7, 2004 Hey, When running the following script, notepad is hidden: RunWait("notepad.exe","",@SW_HIDE) But if I use the same line with RunAsSet, notepad is visible: RunAsSet("administrator", "domain", "password", 0) RunWait("notepad.exe","",@SW_HIDE) RunAsSet() Is there a way of hiding notepad (or any other programs) when running as? CheersNobby Share this post Link to post Share on other sites
sugi 0 Posted September 7, 2004 Hey, When running the following script, notepad is hidden: RunWait("notepad.exe","",@SW_HIDE) But if I use the same line with RunAsSet, notepad is visible: RunAsSet("administrator", "domain", "password", 0) RunWait("notepad.exe","",@SW_HIDE) RunAsSet() Is there a way of hiding notepad (or any other programs) when running as? <{POST_SNAPBACK}>Rerun your own script with specific parameters and in the beginning of your script check if the specific parameters were passed and then run notepad with @SW_HIDE. Share this post Link to post Share on other sites
nobby 0 Posted September 8, 2004 Here is a way of getting around it, not very pretty but it works. Split the script in 2, use the first to call the second as Admin Script1RunAsSet("administrator", "domain", "password", 0) Run("script2.exe","",@SW_HIDE) RunAsSet() Script2RunWait("notepad.exe","",@SW_HIDE) CheersNobby Share this post Link to post Share on other sites
Andre 0 Posted September 8, 2004 Hi, Tried it here also, Looks like an bug to me ? Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Share this post Link to post Share on other sites
sugi 0 Posted September 8, 2004 Looks like an bug to me ?Yes it is a bug in windows. I don't think AutoIt can work around it. Share this post Link to post Share on other sites
Jos 2,165 Posted September 8, 2004 Yes it is a bug in windows. I don't think AutoIt can work around it. <{POST_SNAPBACK}>Here a workaround posted a while ago... its a script example which restars itself .. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
sugi 0 Posted September 9, 2004 Here a workaround posted a while ago... its a script example which restars itself .. <{POST_SNAPBACK}>Yep, that's what I said. You can work around it. But I don't think AutoIt should have a workaround for this. Share this post Link to post Share on other sites