Autor Beitrag
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Do 15.09.05 17:50 
Also, ich möchte mein Prog eine batch datei erstellen lassen und in einem bestimmten ordner ablegen lassen, wie z.B. c:\test\blabla.bat.

Ich habe in einem anderem Forum schon nachgesehen, und teils auch eine kleine Beschreibung gefunden wie eine txt datei erstellt wird, aber nicht um sie dauerhaft abzulegen :)

greetz


Moderiert von user profile iconGausi: Topic aus Windows API verschoben am Do 15.09.2005 um 17:54
ManuelGS
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 173

Win XP HE, Suse Linux
D6, D7, D2005 Personal
BeitragVerfasst: Do 15.09.05 17:53 
:?:
Wenn du eine Datei speicherst ist das so lange dauerhaft, bis du sie löschst.

_________________
"Leben ist gänzlich Bühne und Spiel; so lerne denn spielen
und entsage dem Ernst - oder erdulde das Leid." - Palladas von Alexandria
Born-to-Frag Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Do 15.09.05 18:42 
hat sich schon erledigt, trotzdem thx
Dude566
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Di 11.11.08 16:00 
Wie geht es denn nun, wäre daran interessiert. Bin durch die Suche hier hergekommen, habe sonst nirgends was gefunden.
platzwart
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1054
Erhaltene Danke: 78

Win 7, Ubuntu 9.10
Delphi 2007 Pro, C++, Qt
BeitragVerfasst: Di 11.11.08 16:06 
Was genau willst du denn wissen?
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 11.11.08 17:32 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var sl: TStringlist;
begin
  sl := TStringlist.Create;
  try
    sl.Add('@echo off');
    sl.Add('echo Ich bin eine Batch-Datei');
    sl.Add('pause');
    sl.SaveToFile('C:\test.bat');
  finally
    sl.Free;
  end;
end;

Was ist daran so schwer?
Dude566
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Di 11.11.08 18:15 
Wenn man solche Befehle noch nicht hat ist es schwer, trotzdem Danke.
Achja was muss ich angeben wenn er es in das selbe Verzeichnis speichern soll in dem die Anwendung liegt. Sollte einfach so gehen.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 11.11.08 18:22 
user profile iconDude566 hat folgendes geschrieben Zum zitierten Posting springen:
Achja was muss ich angeben wenn er es in das selbe Verzeichnis speichern soll in dem die Anwendung liegt. Sollte einfach so gehen.
In das Verzeichnis deiner Anwendung solltest du nichts speichern, da du nie sicher sein kannst, dass das auf dem System einfach möglich ist. Bei mir kann ein Programm unter c:\programme nichts schreiben.

Warum habe ich hier geschrieben, und auch warum es ganz ohne Pfanangabe nicht geht. Dort findest du aber nicht nur wie es besser geht sondern auch (wenn du das wider besseres Wissen machen willst) wie du es trotzdem in das eigene Anwendungsverzeichnis schreiben kannst.
www.delphi-library.d...ewtopic.php?p=499701
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Di 11.11.08 19:21 
user profile iconjaenicke hat folgendes geschrieben Zum zitierten Posting springen:
Bei mir kann ein Programm unter c:\programme nichts schreiben.

Und nicht nur er, sondern jeder, der nicht als Admin eingeloggt ist. Und unter Vista selbst dann nicht. Ganz wichtig: Anwendungsdaten haben im Programmordner nichts, ich wiederhole: nichts, ich wiederhole nochmals: nichts, zu suchen. Wo sie stattdessen hinkommen, sagt dir der Link von jaenicke.

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell