Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mo 06.08.07 12:20 
Hi, Delpher,

ich möchte das Prg Notepad mit einer bestimmten Datei starten.
Mein Versuch:

ausblenden Delphi-Quelltext
1:
ShellExecute(Handle, nil, 'C:\Windows\notepad.exe home+'\OUTTXT\sonderzeichen.txt', nil, nil, SW_Show);					


Fehlermeldung : ungültiges Zeichen, nämlich das \

Wie geht es richtig?

Danke für Assistance,
Dtlef
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 06.08.07 12:25 
Moin!

Du hast ein Hochkomman zuviel in der Textkonstante (schau dir doch mal das Syntax-Highlighting an... :roll:). :mahn:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mo 06.08.07 13:01 
Hi, Narses,

hast recht, also jetzt startet das Programm, aber beim Aufruf tut sich nichts, Notepad wird nicht mit der Datei gestartet, der Pfad stimmt, Datei existiert.

:evil:

Hast du noch eine Idee?
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Mo 06.08.07 13:06 
Versuch außerdem mal den absoluten Pfad anzugeben.
ausblenden Delphi-Quelltext
1:
ShellExecute(Handle, nil, PChar('C:\Windows\notepad.exe'),  PChar('home\OUTTXT\sonderzeichen.txt'), nil, SW_Show);					
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 06.08.07 13:07 
Moin!

Der Pfad ist scheinbar relativ, das wird nix :? :arrow: absolut angeben. Weiterhin verlangen unter WinGUI gestartete Anwendungen als ersten Parameter den absoluten Pfad zur Exe, meine ich. :gruebel:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 06.08.07 13:19 
Die Parameter werden bei ShellExecute nicht bei der EXE mit angegeben.
Einfach mal die Hilfe benutzen. Da steht drin, an welcher Stelle die Parameter (z.B. eine Datei) angegeben werden. Das Arbeitsverzeichnis kann auch angegeben werden.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mo 06.08.07 13:23 
Danke, ihr zwei, [äh, drei] das war der Bringer! Wieder was gelernt...

Detlef