BillyG
BillyG

Reputation: 41

WinAPI call to locate a command on the systems path & environment?

I recall seeing an API call or a .NET function where for example if I Start->Run

cmd.exe

it would search the %path% until it locates cmd.exe

So that API would look like

String path = GetFullPathOrWhatever("cmd.exe") // RESULT would be: c:\windows\cmd.exe OR WHEREVER THE SYSTEM WOULD FIND IT

Any ideas which API does this search?

Upvotes: 1

Views: 424

Answers (2)

Kyle Alons
Kyle Alons

Reputation: 7135

SearchPath

Upvotes: 1

YWE
YWE

Reputation: 2909

I believe you are looking for the SearchPath function?

Upvotes: 0

Related Questions