SyMenu Forum

SyMenu

 

HomeTroubleshooting & Bug Reports

If you found a bug post here your report.

Windows Command problem Messages in this topic - RSS

timrray
timrray
Posts: 24


26/09/2024
timrray
timrray
Posts: 24
Hello! I just wanted to report a problem I'm having with the latest version. All of my "windows command" entries stopped working recently. When I run them, I get "The system cannot find the path specified". Upon looking at the command line being launched, it looks like there are double quotes around the actual command I am trying to run. For example, for the windows command "ipconfig /flushdns", Symenu winds up running "cmd.exe /k" ""ipconfig /flushdns"" (note the double quotes around the actual windows command I specified in the Symenu entry).
link
Gianluca
Gianluca
Administrator
Posts: 1274


26/09/2024
Gianluca
Gianluca
Administrator
Posts: 1274
Hello timrray,

Wow... I think this is the first time I receive a bug report so detailed. Thank you for this.

You are right, with the last version I changed the escaping command system.
Before that version escaping a forbidden char was done with the ^ char.


So for example:
C:\(MeAndYou)
that's a perfectly allowed name in Windows but created some problems if executed in a process, was changed in:
C:\^(MeAndYou^)


But this method had some drawbacks for example with the & character.

The solution with the double quotes seems a good one with a minimum impact and instead... some commands fail because of this one.


So a command like:
"ipconfig"
works well regardless the double quotes but:

"ipconfig /all"
won't work at all.... Windows mysteries...

So what can we do now?

I think I could try to recognize when the command contains a path and only in that case I can escape it.
This solution should fix any problem.
What do you think about it?

BTW how are you able to sniff the command send to the shell? I'm asking because it could be a useful technique for me too.
+1 link
timrray
timrray
Posts: 24


08/10/2024
timrray
timrray
Posts: 24
You are welcome! I have to do this sort of thing while writing my own scripts on occasion. In this instance, I used Process Explorer, which I installed into my SyMenu from the Suite.

If you run the app, you can choose which columns are visible in the process list. If you add "Command Line" to the columns you can see it. I usually either try to find the process, or, using the small target icon on Process Explorer, you can drag that target over the window you are interested in and process explorer will take you right to that specific process.

I'm open to testing anything you might try to cook up. Sorry for the delayed response.
link



UGMFree © 2002-2024
PayPal BTC TON