%S Paramter let VBS SCRIPT CRASH OR NOT EVEN EXECUTE

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48166
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

How does the association of .au3 with AutoIt look like?
Is it
D:\Programme\AutoIt3\AutoIt3.exe %1
or
D:\Programme\AutoIt3\AutoIt3.exe "%1"
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9422
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

I guess that's the one you're looking for:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Run\Command]
@="D:\\Programme\\AutoIt3\\AutoIt3.exe \"%1\" %*"
And here's the one for VBS:

Code: Select all

%SystemRoot%\System32\WScript.exe "%1" %*
(It's a REG_EXPAND_SZ so I've posted it in clear text instead of the binary stuff.)

[ADD]
But it can't have anything to do with the file type's association since it works correctly as soon %S is removed from the parameter field.

[ADD2]
BTW: This bug is not limited to button bar but the starter menu is also affected. So TC's handling of commands is wrong when %S is used in the parameters field.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Dalai
Power Member
Power Member
Posts: 9422
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

How can I convince you that this is an actual bug that needs fixing?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48166
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I cannot prevent VBSCript from crashing. :(
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9422
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Do we have to go through that again? Did you take a look at the command line of wscript.exe or autoit3.exe when one of the above buttons is launched that contains %S in the parameter field?

It's really simple: In Process Explorer, compare the command lines TC launches, one button containing %S in the parameter field, the other one without it. There's no crash, it's TC removing all quotes, so wscript.exe or autoit3.exe (or any other I guess) can't find their stuff.

Somebody else have any other idea how we can help Ghisler with this?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48166
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

But %S does automatically surround names with spaces with ""! Maybe it's because you combine %L and %S? That doesn't really make any sense...
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9422
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

%L doesn't matter here, you can try any combination of parameters together with %S, or %S alone, add some other parameter like "test", it doesn't matter. Please just check for yourself that TC DOES NOT quote any parameters when %S is used! Even worse, it removes the quotes if any were set, either in the button itself or in the registry.

I don't know what else I can say. I posted the relevant buttons, screenshots of the command lines in Process Explorer and I've described multiple times what's wrong.

Please just check the command lines of the processes TC launches in Process Explorer, it will only take a few minutes.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Okay (once again)

1. No file selected, Cursor placed on "C:\test\Test Script.vbs"

2. CORRECT:

Code: Select all

TOTALCMD#BAR#DATA
"C:\test\Test Script.vbs"
%P%N
C:\Windows\System32\WScript.exe,2
Test Script
C:\test\

-1
-> Command line by Proccess Explorer:

Code: Select all

"C:\Windows\System32\WScript.exe" "C:\test\Test Script.vbs" "C:\test\Test Script.vbs"
3. WRONG:

Code: Select all

TOTALCMD#BAR#DATA
"C:\test\Test Script.vbs"
%P%S
C:\Windows\System32\WScript.exe,2
Test Script
C:\test\

-1
-> Command line by Proccess Explorer:

Code: Select all

C:\Windows\System32\WScript.exe C:\test\Test Script.vbs "C:\test\Test Script.vbs"

Tested with TC9.0B5 x64 (Windows 7)

This is definitely a problem of TC!

Regards
Holger
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48166
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

So it's not the quotes around %P%S, but around the program? That doesn't really make any sense. But I will check it in the debugger.
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9422
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

ghisler(Author) wrote:So it's not the quotes around %P%S, but around the program?
And around the parameters that are not added by %S, in Holger's case C:\test\Test Script.vbs, where the cursor was when pushing the button.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48166
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

C:\test\Test Script.vbs
That's not in the parameter field, but in the program field. And it's the same as when using %P%N...
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9422
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

ghisler(Author) wrote:
C:\test\Test Script.vbs
That's not in the parameter field, but in the program field.
Oops, you're right.
And it's the same as when using %P%N...
???
The button contains the same string ("C:\test\Test Script.vbs"), but the result is different, depending on whether %S is used in the parameter field.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48166
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I found the problem - when you use parameter %S, TC uses CreateProcess to open the program, because it supports longer command lines than ShellExecuteEx. Since CreateProcess cannot open vbs files, I have to determine the associated program, and launch that with the vbs as a parameter. Here this double quotes were lost.

Please try again with beta 6!
Author of Total Commander
https://www.ghisler.com
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Seems to be okay here.
Tested with the above buttons and TC9.0b6 (x86/x64) under Win7.

Regards
Holger
User avatar
Dalai
Power Member
Power Member
Posts: 9422
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Yep, now it works correctly.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply