blademonkey Posted April 26, 2006 Share Posted April 26, 2006 Hey guys, It's been a while since i've been in the forums. I've done some research on this but i haven't seen anything conclusive. Here's the deal. I'm running some enterprise wide GPO loginscripts. I often update these scripts and will in the future open my code up for some other techs to make updates/changes. I am trying to redirect the standard error (and subsequent) outputs to write to a file or to console. The problem is that if, for any reason at all, a script is created/updated/changed and it causes some errors, EVERYONE that the GPO script applies to will be subject to a potential error message. Please advise. Thanks. -Lawrence ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
blindwig Posted April 26, 2006 Share Posted April 26, 2006 I don't know what a GPO script is, but under the command intrepreter: PROGRAM 1>StdOut.Txt 2>StdErr.Txt this will run "PROGRAM" (BAT, COM, or EXE) and direct standard out to StdOut.Txt and standard error to StdErr.Txt My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
blademonkey Posted April 27, 2006 Author Share Posted April 27, 2006 I don't know what a GPO script is, but under the command intrepreter:PROGRAM 1>StdOut.Txt 2>StdErr.Txtthis will run "PROGRAM" (BAT, COM, or EXE) and direct standard out to StdOut.Txt and standard error to StdErr.TxtGPO = Group Policy Object. GPO Script is a login script that is run at the Group Policy level as soon as users login or logoff. Unlike the traditional NT logon scripts, it supports UNC ,has no problem doing runas commands, and it completely invisible (i.e. no DOS/CMD window pops up).The redirection I am looking for is autoit-centric. I am trying to redirect error popups from autoit to text files. For instance, if I were to compile the following code I would get the error message in the attached file:msgbox(0,"tesT","there's a parenthesis missing"I would like to redirect the error and standard output to a text file so that users will not see any potential errors.hope that clears it up. ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
blindwig Posted April 27, 2006 Share Posted April 27, 2006 GPO = Group Policy Object. GPO Script is a login script that is run at the Group Policy level as soon as users login or logoff. Unlike the traditional NT logon scripts, it supports UNC ,has no problem doing runas commands, and it completely invisible (i.e. no DOS/CMD window pops up).The redirection I am looking for is autoit-centric. I am trying to redirect error popups from autoit to text files. For instance, if I were to compile the following code I would get the error message in the attached file:msgbox(0,"tesT","there's a parenthesis missing"I would like to redirect the error and standard output to a text file so that users will not see any potential errors.hope that clears it up.OK, MsgBox is not an output function, it's a GUI function. There is no easy way to "redirect it" without hooking into the GUI or writing another external watcher script.The best way to not see those errors is to go through your code and replace the MsgBox function calls with something else, for example use FileWrite to write your errors to a log file or something. My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
blademonkey Posted April 28, 2006 Author Share Posted April 28, 2006 (edited) OK, MsgBox is not an output function, it's a GUI function. There is no easy way to "redirect it" without hooking into the GUI or writing another external watcher script.The best way to not see those errors is to go through your code and replace the MsgBox function calls with something else, for example use FileWrite to write your errors to a log file or something.I'm not trying to redirect the msgbox output, just the error output from the script.If you compile the code and run it, you will see what I mean. Msgbox was just an example, if you have been a bad if statementif 1 then Edited April 28, 2006 by blademonkey ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
blindwig Posted April 28, 2006 Share Posted April 28, 2006 Oh yeah, well, the solution to that is to write code that doesn't throw errors! My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
blademonkey Posted April 29, 2006 Author Share Posted April 29, 2006 Oh yeah, well, the solution to that is to write code that doesn't throw errors! I'll try to remember that line when you, yourself, get errors . ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
MHz Posted April 29, 2006 Share Posted April 29, 2006 (edited) To save a absolute mistake shown when in public view, then /ErrorStdOut may help. Logging would be a different story.Edit:Reference link Edited April 29, 2006 by MHz Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now