Modify

Opened 15 years ago

Closed 14 years ago

#1618 closed Bug (Works For Me)

ShellExecute("C:\") causes script hanging

Reported by: MrCreatoR <mscreator@…> Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.0 Severity: None
Keywords: Cc:

Description

If we use ShellExecute("C:\") as last command in the script (just before we exit the script), then the script is hanged (no Exit operation is performed). The default tray icon is dissapeared, but the process does not terminated fully.

Example:

ShellExecute("C:\")
;MsgBox(0, "", "Exit")
Exit

if we uncomment the msgbox line, then everything is ok, the script will exit with no problems.

This is happening when the first parameter is passed as literal string, but strangly not when drive letter is passed without a back slash ("C:", "D:" etc.), without it the script exits ok.

Here is few tests that showing strange results:

Not Exits

$sVar = "c:\"
ShellExecute($sVar)
Exit

Not Exits

ConsoleWrite(@HomeDrive & @LF)
ShellExecute(@HomeDrive)
Exit

Exits

ShellExecute(@HomeDrive)
Exit

Not Exists

ShellExecute(@HomeDrive & "\")
Exit

AutoIt:3.3.6.0 (Os:WIN_XP/X86/Service Pack 3 Language:0419 Keyboard:00000409 Cpu:X64)

Attachments (0)

Change History (27)

comment:1 follow-up: Changed 14 years ago by Jpm

I cannot reproduce the problem under a virtual PC.
the explorer open OK and using an OnAutoItExitRegister display a msgbox.
anyway no AutoIT3.exe is still running
How do you proof there is an error?

comment:2 Changed 14 years ago by rbhkamal@…

This might be related.. it always gets stuck no matter what you do

Run( "cmd.exe" )
ConsoleWrite( "Now should exit!" & @lf )
Exit

comment:3 Changed 14 years ago by anonymous

Last Reply is not related to this trac issue. And is allready Solved.
http://www.autoitscript.com/forum/index.php?showtopic=114536&view=findpost&p=800598

comment:4 Changed 14 years ago by anonymous

It is working fine.

comment:5 in reply to: ↑ 1 Changed 14 years ago by MrCreatoR <mscreator@…>

Replying to Jpm:

the explorer open OK and using an OnAutoItExitRegister display a msgbox.

Yes, with OnAutoItExitRegister everything is fine, but not with direct exit.

How do you proof there is an error?

If you can, please download this video (1.91 mb packed, 11.9 mb unpacked), it shows up my issue.

I don't know what is wrong there, but sometimes the bug is not reproducable (unstable bug :) ), sometimes i need to "play" with the lines, for example add a messagebox or any other function (after ShellExecute), run the script, and then remove the added function, then the bug is back, stragne...

comment:6 Changed 14 years ago by MrCreatoR <mscreator@…>

BTW, it's not related to SciTE, the same happens when executing from explorer.

And i have tested the issue on last 3.3.6.1 version, the bug is still there :(

comment:7 follow-up: Changed 14 years ago by anonymous

@MrCreatoR: Use the taskmanager to see if AutoIt is still running. If its not, this problem is now resolved by a new beta AutoIt3Wrapper. Download it and test again. Should solve your problem. (and this ticked)

comment:8 in reply to: ↑ 7 Changed 14 years ago by MrCreatoR <mscreator@…>

Replying to anonymous:

@MrCreatoR: Use the taskmanager to see if AutoIt is still running.

If i wrote that «the same happens when executing from explorer» then i definitly have checked and confirmed that AutoIt porocess is still runing ;)

comment:9 follow-up: Changed 14 years ago by Jpm

As I understand you don't use the ScIte4Autoit3.
Perhaps it works different with.

Anyway I dont understand the explorer behavior ...
Something must be wrong with your system ... I cannot reproduce it.
Try on another XP system ...

comment:10 Changed 14 years ago by anonymous

Replying to MrCreatoR <mscreator@…>:

If i wrote that «the same happens when executing from explorer» then i definitly have checked and confirmed that AutoIt porocess is still runing ;)

Fair enough.

@general:
I manged to get a fiew instances where AutoIt was staying active while it should have closed. (out of way to many tries, with task manager on the side)
Other than the fact that I mange to capure one(1) with AutoIt 3.3.6.1 and AutoIt3Wrapper v.2.0.1.33 (Running from Scite4AutoIt!), any additional info would be more or less speculative.
Whiteout some stable reproducible example or info to that effect I don't see this going anywhere.

comment:11 follow-up: Changed 14 years ago by Jpm

Can I have an idea who is behind @anonymous?
Just curiosity ;)

comment:12 in reply to: ↑ 11 Changed 14 years ago by anonymous

Replying to Jpm:

Can I have an idea who is behind @anonymous?
Just curiosity ;)

Not sure if that a good idea, from my point of view.
But, well in this case, MvGulik.

comment:13 Changed 14 years ago by Jpm

Thanks MvGulik
That's not solving MrCreatoR issue but it help me to understand who is really helping to solve track issue

comment:14 in reply to: ↑ 9 Changed 14 years ago by MrCreatoR <mscreator@…>

Replying to Jpm:

As I understand you don't use the ScIte4Autoit3.

It's a modified version of it.

Try on another XP system ...

I have, on Win XP SP2 Hebrew, the fisrt run is fine, but then i tried to play with the examples from my first post...

An attempt to reproduce the bug by following these steps:

  1. Create an empty autoit script on the desktop.
  2. Write to it just one line:
    ShellExecute("C:\")
    
  3. Now Run the script (F5), it's should exit properly.
  4. Now replace the script content with these lines:
    $sVar = "c:\"
    ShellExecute($sVar)
    Exit
    
  5. Run the script once again.
  6. If the script still exits properly (check the console), please follow these sub-steps:
    1. Repeat step 4 but replace with this:
      ShellExecute("C:\")
      MsgBox(0, "", "Exit")
      Exit
      
    2. Now comment the MsgBox line.
    3. Run the script (F5).
    4. If at this point the script still exists properly, then (as a last attempt) please replace the script content with the initial line:
      ShellExecute("C:\")
      
      and try to run the script again.

Tested on AutoIt 3.3+

comment:15 follow-up: Changed 14 years ago by Jpm

I don't understand which version of Scite4Autoit you are using.
Just use the standard one.
I try your repro scenario but nothing failed under Win7/X86 standard Scite4AutoIt

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "D:\AdmMesnage\AutoIt\Reports\#1618 ShellExecute hang.au3" /autoit3dir "C:\Program Files\AutoIt3\SciTE\.." /UserParams    
+>19:33:31 Starting AutoIt3Wrapper v.2.0.1.32    Environment(Language:040C  Keyboard:0000040C  OS:WIN_7/  CPU:X64 OS:X86)
>Running AU3Check (1.54.19.0)  params:-d -w 1 -w 2 -w 3 -w 5 -w 6  from:C:\Program Files\AutoIt3\SciTE\..
+>19:33:31 AU3Check ended.rc:0
>Running:(3.3.6.1):C:\Program Files\AutoIt3\SciTE\..\autoit3.exe "D:\AdmMesnage\AutoIt\Reports\#1618 ShellExecute hang.au3"    
+>19:33:31 AutoIT3.exe ended.rc:0
>Exit code: 0    Time: 1.692

I will certainly close this ticket as "Works for me"

comment:16 Changed 14 years ago by mvg

I think I found a stable reproduction. (at MrCreatoR step 3)
But every time I change something to reduce the clutter the hangup disappears with it. :P

comment:17 Changed 14 years ago by mvg

Sorry.
While trying to write down a long reproduction (mainly for initial personal use) I lost it again. (It went back to rare and random)

Checked if I could get a compiled exe to hangup. yes (one(1) time out of many run's)(just doing run,run,run,...)

I'm out of ideas.

comment:18 in reply to: ↑ 15 Changed 14 years ago by MrCreatoR <mscreator@…>

Replying to Jpm:

I don't understand which version of Scite4Autoit you are using.

It's not SciTE related, i have tried the original from autoit, the modofied (by me), and the russian version (from ru-board.com), on all versions i can reproduce the bug, and even without them at all, i am executing from the desktop and AutoIt3.exe remains in the tasks list.

I try your repro scenario but nothing failed under Win7/X86 standard Scite4AutoIt

And what about Win XP?

comment:19 Changed 14 years ago by MrCreatoR <mscreator@…>

Ok, i think i found a real reproducing scenario, if not, then i give up :)

Please download this archive, extract it to the desktop, and run the compiled script first time, then check the processes list, if it's not there, run it again, and if still you got no luck, just delete the extracted files, the archive, and this ticket :D

comment:20 Changed 14 years ago by Jpm

I can't reproduce it under Win7/FR or WinXP/SP3/FR
perhaps it is related with the Win.../Russian version but I can't test it
Sorry for not helping more (sniff sniff)

comment:21 Changed 14 years ago by MrCreatoR <mscreator@…>

[quote]perhaps it is related with the Win.../Russian versionquote
I have tested the issue on Hebrew Win XP... can any one else please test the script from my last post?

comment:22 Changed 14 years ago by Jpm

Please help MrCreatoR in testing his last post script on "non Latin" Windows version. Without any answer I will close this ticket

comment:23 Changed 14 years ago by GEOSoft

I ran this several times and it worked every time. The AutoIt3 process closed as it should.

For $i = 0 To 10
    ShellExecute("c:\")
	Sleep (2000)
Next
Exit

One thing I did notice though, I don't think it will be related at all.
ShellExecuteWait() doesn't wait for the explorer window to be closed before the script exits

ShellExecutewait("c:\")
Exit

comment:24 follow-up: Changed 14 years ago by MrCreatoR <mscreator@…>

I ran this several times and it worked every time

It's not matter how many times this will run (i am talking about the loop), it's all related to the way that the lines are executed and the run sequence.
Please try the compiled script from my post above.

comment:25 in reply to: ↑ 24 Changed 14 years ago by GEOSoft

Replying to MrCreatoR <mscreator@…>:

I ran this several times and it worked every time

It's not matter how many times this will run (i am talking about the loop), it's all related to the way that the lines are executed and the run sequence.
Please try the compiled script from my post above.

Now I see what you mean. Sorry about that.

comment:26 Changed 14 years ago by Jpm

@GEOSoft
What are you sorry about?
did you reproduce the pb in your environment?

comment:27 Changed 14 years ago by Jpm

  • Resolution set to Works For Me
  • Status changed from new to closed

as I understand it cannot be reproduced in an non latin window version.
Sorry for those designers/users.
So I close it as "Work for me"

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.