crystalburner Posted March 7, 2007 Share Posted March 7, 2007 Seems all my scripts are broken! Fault appears to be running on Vista, the RUN(@comspec & ' /c xyz....... , @sw_hide,$STDERR_CHILD + $STDOUT_CHILD) While 1 $line = StdoutRead($process) If @error Then ExitLoop Wend There is more code in the while wend loop to analyse the output of the command line and do certain things, under all OS's its fine except vista where $line is permanently empty (script never gets the console output) and so the loop never ends and the app doesnt work because you can't get the console output and act on it! Link to comment Share on other sites More sharing options...
crystalburner Posted March 7, 2007 Author Share Posted March 7, 2007 Oh, by the way, i was asking for help!!!! If anyone has an answer. Only thing I can think of is output the console to text and read the text file, but thats a bit pants Seems all my scripts are broken! Fault appears to be running on Vista, the RUN(@comspec & ' /c xyz....... , @sw_hide,$STDERR_CHILD + $STDOUT_CHILD) While 1 $line = StdoutRead($process) If @error Then ExitLoop Wend There is more code in the while wend loop to analyse the output of the command line and do certain things, under all OS's its fine except vista where $line is permanently empty (script never gets the console output) and so the loop never ends and the app doesnt work because you can't get the console output and act on it! Link to comment Share on other sites More sharing options...
Valuater Posted March 7, 2007 Share Posted March 7, 2007 (edited) its only one more step to read a file (+/- not meant as argumentative or... pants) 8) EDIT: I do what works and move-on... 8) Edited March 7, 2007 by Valuater Link to comment Share on other sites More sharing options...
crystalburner Posted March 7, 2007 Author Share Posted March 7, 2007 Is that English?!I guess that basically means nobody has a clue about what goes on with Vista and the console... its only one more step to read a file (+/- not meant as argumentative or... pants)8)EDIT: I do what works and move-on... 8) Link to comment Share on other sites More sharing options...
Valuater Posted March 7, 2007 Share Posted March 7, 2007 Is that English?!I guess that basically means nobody has a clue about what goes on with Vista and the console...I don't know... Is it???8) Link to comment Share on other sites More sharing options...
crystalburner Posted March 7, 2007 Author Share Posted March 7, 2007 (edited) (comment removed) (comment removed)Im going to shut up now i've had too much to drink - i need to lie down !I don't know... Is it???8) Edited March 7, 2007 by crystalburner Link to comment Share on other sites More sharing options...
SadBunny Posted March 7, 2007 Share Posted March 7, 2007 Hi all First your run command is totally messed up right now but I'm guessing you typed that as a concept example I tested this exact code in Vista Business NL 32 bits and it works like a charm: #include <Constants.au3> $process = RUN(@comspec & " /c dir c:\","",@sw_hide,$STDOUT_CHILD) Do $line = StdoutRead($process) MsgBox(0,"test","line: "&$line) If @error Then ExitLoop Until $line="" Seems like the Stdoud behaves exactly like you would expect it to. BUT... I disabled UAC before. Maybe that's the issue. I'll need to reboot my Vista laptop now to ENable UAC and then I'll retry. Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
SadBunny Posted March 7, 2007 Share Posted March 7, 2007 BUT... I disabled UAC before. Maybe that's the issue. I'll need to reboot my Vista laptop now to ENable UAC and then I'll retry.No, that's not it. I rebooted Vista with UAC enabled, and this script still returns the DIR output like it should. You sure your command actually gives standard output in Vista? Maybe it's not the reading of the Stdout by your script, but the StdOut outputting by your source. Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
crystalburner Posted March 7, 2007 Author Share Posted March 7, 2007 No, that's not it. I rebooted Vista with UAC enabled, and this script still returns the DIR output like it should. You sure your command actually gives standard output in Vista? Maybe it's not the reading of the Stdout by your script, but the StdOut outputting by your source.try output from RASDIAL Link to comment Share on other sites More sharing options...
SadBunny Posted March 7, 2007 Share Posted March 7, 2007 try output from RASDIAL Tried it. Returns two lines perfectly ok. Exact code used for testing: #include <Constants.au3> $process = Run(@comspec & " /c rasdial","",@sw_hide,$STDOUT_CHILD) Do $line = StdoutRead($process) MsgBox(0,"test","line: "&$line) If @error Then ExitLoop Until $line="" Lines returned: Geen verbindingen (<-- no connections) Opdracht voltooid. (<-- command completed) Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
crystalburner Posted March 7, 2007 Author Share Posted March 7, 2007 Under XP your script returns No connections Command Completed OK Under Vista it does No Connections OK Command Completed OK But it does work, mine works perfectly on XP/2000 but not vista $process = Run(@ComSpec & ' /C ' & 'rasdial ' &chr(34) & 'Qual-IT Connect!' & chr(34) & ' ' & $username & ' ' & $password & ' /PHONE:' & $ipaddress & ' /PHONEBOOK:' & @TempDir & '\' & $phonebook, @scriptdir, @sw_show,$STDERR_CHILD + $STDOUT_CHILD) GuiCtrlSetData ($Progress_1, 80) ; set a real progress bar based on the qty of files to download $connect=0 While 1 $line = StdoutRead($process) If @error Then ExitLoop $findit=StringInStr ( $line, "Successfully connected" ) if $findit <> 0 Then $connect=1 if $connect = 0 then GuiDelete ($prog) connect() return ' ' endif Wend Traytip ($appname, "Connected to " & $ipaddress,20) GuiDelete ($prog) EndFunc Tried it. Returns two lines perfectly ok. Exact code used for testing: #include <Constants.au3> $process = Run(@comspec & " /c rasdial","",@sw_hide,$STDOUT_CHILD) Do $line = StdoutRead($process) MsgBox(0,"test","line: "&$line) If @error Then ExitLoop Until $line="" Lines returned: Geen verbindingen (<-- no connections) Opdracht voltooid. (<-- command completed) Link to comment Share on other sites More sharing options...
SadBunny Posted March 7, 2007 Share Posted March 7, 2007 (edited) But it does work, mine works perfectly on XP/2000 but not vistaHmm... Can't test your exact code without your data and the rest of your code ofcourse, but:1 - Where does it go wrong and what happens?2 - If you run the exact command from a command prompt, does it actually produce output under Vista? (Just asking to be sure. This because you say yourself that the rasdial output without parameters does actually make this script work on your system, so I'm still suspecting a difference in output from your command in different Windows versions...)/edit: typo Edited March 7, 2007 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
crystalburner Posted March 7, 2007 Author Share Posted March 7, 2007 I think i'll have to playIm not imagining things, the script is fukt under vista, its been running for several clients for a year on xp/2000I've got it to kind of work under vista, ish -after rasdial the output should be if successful "connected" - i never get that from stdoutbut if i put it in a loop and run the command again i do get "already connected" which i can act onnot ideal but i'll keep playingagain, scripts work very well on xp/2k so something is different hereits a clean install of vista ultimate rtmnice, on my 512meg laptop task manager shows 0k free with just the OS running!Hmm... Can't test your exact code without your data and the rest of your code ofcourse, but:1 - Where does it go wrong and what happens?2 - If you run the exact command from a command prompt, does it actually produce output under Vista? (Just asking to be sure. This because you say yourself that the rasdial output without parameters does actually make this script work on your system, so I'm still suspecting a difference in output from your command in different Windows versions...)/edit: typo Link to comment Share on other sites More sharing options...
SadBunny Posted March 9, 2007 Share Posted March 9, 2007 nice, on my 512meg laptop task manager shows 0k free with just the OS running!I have 532 MB in use of 1 GB total Could be right.But anyway, I *MIGHT* have found something Vista-related that might interest you. I posted a question about Vista access a couple of days ago but did not get any answer... After some developer research I found my answer, don't know if it helps but it never hurts to try. See my thread: http://www.autoitscript.com/forum/index.php?showtopic=42213Cheers. Roses are FF0000, violets are 0000FF... All my base are belong to you. 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