Mahlzeit,
das Standard 'OPEN DOC' vi von LabVIEW (2021) hat bei mir nicht immer funktioniert, bis ich drauf gekommen bin, dass es nur bei Kunden mit einem & im Namen passiert.
Das ist aber mit 'cmd /c "%s"' command-Formatierung nicht möglich und ich habe mir nen Wolf gesucht das zu umgehen.
Letztendlich hat mir GPT geholfen und eine einfache Änderung auf 'cmd /c start "" "%s"' hat den Fehler behoben, sonst habe ich nichts geändert.
Mit der Übergabe der Befehle an 'start' wird die Befehlsinterpretation ausgeschalten.
[
attachment=62883]
Ich hoffe ich spare anderen hiermit etwas gesuche,
mfg
Timo
(09.04.2025 10:21 )TpunktN schrieb: [ -> ]'cmd /c start "" "%s"'
Interessant, dass es noch mehr Möglichkeiten gibt. Ich hatte mich bisher immer an den Satz
Zitat:You must use quotation marks around the following special characters: & < > [ ] | { } ^ = ; ! ' + , ` ~ [white space].
(siehe:
https://learn.microsoft.com/en-us/window...mmands/cmd)
gehalten.
Also z.B. für die Datei c:\temp\aa&bb.pdf:
cmd /c c:\temp\aa"&"bb.pdf
es funktioniert aber auch
c:\temp\"aa&bb.pdf"
(10.04.2025 10:44 )Martin.Henz schrieb: [ -> ]Also z.B. für die Datei c:\temp\aa&bb.pdf:
cmd /c c:\temp\aa"&"bb.pdf
es funktioniert aber auch
c:\temp\"aa&bb.pdf"
Wusste ich nicht, mein Fehler bei meinen Tests, ich habe alles in "" geschrieben (cmd /c "c:\temp\aa"&"bb.pdf"), dann geht es nicht..
Aus neugier ausprobiert wie es ist, wenn im Ordnerpfad noch Leerzeichen enthalten sind, dann so: C:\"temp 0"\test\"aa&bb.txt"
Dennoch unpraktisch, dann muss ich ja den Pfad untersuchen.
Ich habe den Teil gelesen und wohl missverstanden:
https://learn.microsoft.com/en-us/window...mmands/cmd schrieb:If you specify /c or /k, the cmd processes, the remainder of <string>, and the quotation marks are preserved only if all of the following conditions are met:
You don't also use /s.
You use exactly one set of quotation marks.
You don't use any special characters within the quotation marks (for example: & < > ( ) @ ^ | ).
You use one or more white-space characters within the quotation marks.
The <string> within quotation marks is the name of an executable file.
If the previous conditions aren't met, <string> is processed by examining the first character to verify whether it's an opening quotation mark. If the first character is an opening quotation mark, it's stripped along with the closing quotation mark. Any text following the closing quotation marks is preserved.
Das NI mitgelieferte VI macht nur cmd /c "%s" und das funktioniert dann nicht mit &.
Ich habe wirklich viel gegoogelt um das irgendwie gelöst zu bekommen und dann gibt es mehrere Lösungen, danke Martin
Timo
Hallo Timo,
ja, das was cmd.exe diesbezüglich haben möchte ist in keiner Weise logisch. Es scheint auch keinerlei Interesse zu bestehen, diesen kaputten Parser in cmd.exe reparieren zu wollen. Stattdessen hat irgend jemand bei Microsoft versucht dieses seltsame Verhalten so zu beschreiben, dass es halbwegs korrekt ist.