Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

hallo zusammen

habe ein kleines program unter c++ (borland) geschrieben was auch soweit lauffähig ist.

unter dos läuf es bereits einwandfrei. ich möchte es jedoch unter ntfs-dos lauffähig bekommen ohne das nt4 gestartet wird.

der quellcode sieht derzeit so aus:

//---------------------------------------------------------------------------

#include <registry.hpp>

#include <iostream.h>

#include <fstream.h>

//---------------------------------------------------------------------------

int main()

{

system("ntfsdos.exe");

char SetPcName[16];

AnsiString GetPcName;

cout << "Bitte neuen PcNnamen eingeben: ";

cin >> SetPcName;

TRegistry &read = *new TRegistry();

read.RootKey=(HKEY_LOCAL_MACHINE);

bool Bx = read.OpenKey("SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ComputerName",false);

if (Bx) {

GetPcName=read.ReadString("ComputerName");

fstream datei;

datei.open("go.bat",ios_base::out);

datei << "sidchngr 0\\winnt /r /cr=" << GetPcName.c_str() << ", " << SetPcName << " /b /o=" << SetPcName;

datei.close();

read.CloseKey();

}

delete &read;

system("go.bat");

return 0;

}

//---------------------------------------------------------------------------

wenn ich den quelcode in eine ne *.c einfüge und ausführen lasse hat er jedes mal probleme mit dem 'fstream' . hat einer von euch einen tip wie ich das ganze unter ntfs-dos zum laufen bekommen kann?

ich danke euch schonmal im vorraus

cosmo

Originally posted by cosmo

wenn ich den quelcode in eine ne *.c

Das ist kein C-Code, Du solltest Die Datei .cpp nennen.
einfüge und ausführen lasse
Kompilierst Du zwischendurch auch?
hat er jedes mal probleme mit dem 'fstream' .
<Gebetsmühle>

Fehlermeldungen erleichtern die Diagnose.

</Gebetsmühle>

danke erstmal für die unterstützung.

klar kompiliere ich. der quellcode ist von einer cpp. ich möchte jedoch das programm unter ntfs-dos also als 16-bit-programm starten können. die ntsfdos.exe ermöglicht den zugriff auf die partitionen. mein problem ist nur das die fstream() aus der fstream.h kommt und nur von c++ unterstützt wird (32-bit). ich habe aber eventuell eine möglichkeit gefunden um die dateiausgabe unter c hinzubekomen. obs klappt weiss ich noch nicht. das muss ich erst noch austesten.

gruss cosmo

ich dachte mir das wenn ich das ganze unter c lauffähig mache das dann das programm auch unter ntsf-dos lauffähig ist. c wurde doch für 16-bit-anweisungen geschrieben oder ?

danke für den tip mit fopen. ich werds mal ausprobieren. habe auch noch das fwrite gefunden das ja noch harwarenäher sein soll und mich hoffendlich den ziel auch noch ein stück näher bringt

gruss

cosmo

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.