Title: AutoExec.Bat (Exe) for Windows ME
Question: Hay, I've installed this cool Windows ME, but I can't Subst, or load anything on start up.
Answer:
Well I knocked this together when I was DESPERATE to make subst drives in my windowsME, but the problem was if I just called a batch file from the "software\microsoft\windows\currentversion\run" it would display an ugly black screen. So this is my solution
Requires no forms, just replace the code in your project with this
program autoexe;
uses
Windows,
Shellapi,
sysutils,
Forms;
{$R *.RES}
function ExecuteFile(const FileName, Params, DefaultDir: string;
ShowCmd: Integer): THandle;
var
zFileName, zParams, zDir: array[0..79] of Char;
begin
Result := ShellExecute(application.Handle, nil,
StrPCopy(zFileName, FileName), StrPCopy(zParams, Params),
StrPCopy(zDir, DefaultDir), ShowCmd);
end;
begin
executefile('c:\windows\command\autoexe.bat','','C:\',sw_Hide);
end.