Windows Path-Variablen bei C++ verwenden

Diskutiere Windows Path-Variablen bei C++ verwenden im Developer Network Forum im Bereich Hardware & Software Forum; hi wie kann ich In C++ path variablen von der eingabe aufforderung ( start > ausführen > cmd > set ) verwenden. also copieren x nach %windir%...
  • Windows Path-Variablen bei C++ verwenden Beitrag #1
Max11.111

Max11.111

Bekanntes Mitglied
Dabei seit
12.06.2008
Beiträge
2.416
Reaktionspunkte
0
hi
wie kann ich In C++ path variablen von der eingabe aufforderung ( start > ausführen > cmd > set )
verwenden.

also copieren x nach %windir%

kann mir einer halfen ( bitte detailiert da ich schwer von begriff bin ) :iro:
 
  • Windows Path-Variablen bei C++ verwenden Beitrag #2
U

UnimatrixZero

Bekanntes Mitglied
Dabei seit
27.06.2001
Beiträge
645
Reaktionspunkte
0
Siehe Platform/Windows-SDK:

GetEnvironmentVariable


Retrieves the contents of the specified variable from the environment block of the calling process.

DWORD WINAPI GetEnvironmentVariable(
LPCTSTR lpName,
LPTSTR lpBuffer,
DWORD nSize
);

Parameters


lpName [in] The name of the environment variable. lpBuffer [out] A pointer to a buffer that receives the contents of the specified environment variable as a null-terminated string. An environment variable has a maximum size limit of 32,767 characters, including the null-terminating character. nSize [in] The size of the buffer pointed to by the lpBuffer parameter, in characters. Return Value

If the function succeeds, the return value is the number of characters stored in the buffer pointed to by lpBuffer, not including the terminating null character.
If lpBuffer is not large enough to hold the data, the return value is the buffer size, in characters, required to hold the string and its terminating null character.
If the function fails, the return value is zero. If the specified environment variable was not found in the environment block, GetLastError returns ERROR_ENVVAR_NOT_FOUND.
 
Thema:

Windows Path-Variablen bei C++ verwenden

ANGEBOTE & SPONSOREN

https://www.mofapower.de/

Statistik des Forums

Themen
213.179
Beiträge
1.579.172
Mitglieder
55.878
Neuestes Mitglied
Satan666
Oben