We help IT Professionals succeed at work.

I need a code to do some things (mostly withing registry)

tadzio_blah
tadzio_blah asked
on
504 Views
Last Modified: 2010-04-05
Hi

I need a proggy that will do those things (in order):

1. Check if specified exe stored in const string exists (the exe will be stored in the same dir as the proggy), if not then display error msg and then exit.
2. Save the HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi and all of its contents to a reg file to be ready to import to registry.
3. Delete all saved data from the registry
4. Launch exe (from the const string), and wait untill it finishes.
5. Load the reg file and put back the registry entries
6. Display the succsess dialog

The reg file is needed in case of machine hang or sthing like that.

Thx in advance
Comment
Watch Question

CERTIFIED EXPERT

Commented:
This isnt a question of how to resolve an issue.  You are asking us to write a program for you.  That's $100 /hour.

Good Luck
Mark BradyPrincipal Data Engineer
CERTIFIED EXPERT

Commented:
I charge $150 per hour but I'll do it for $100 as long as you send both me and Kfoster11 a case of beer each :)

Elvin


P.s.  A quick suggestion for you.  Why don'y you design your program (GUI) and make as many of the functions/procs as you can and test them.  With the ones you are having trouble with, post a single question for each procedure you have difficulty with and someone will help you out.  Use google to search for subjects on your particular procedure and you will be amazed at what you find.

Cheers
Hi tadzio_blah

Here:

add 'registry' to your uses clause in the unit where you are going to use the following procedure.

procedure SomeProc(Sender: TObject);
var reg : TRegistry;
begin
  If not fileexists(**your constant string**) then begin
    MessageDlg(Format('Error!'#13'The file /s cannot be found!'#13'Please Contact your'+
     ' System Administrator',[**your constant string**]),mtError,[mbOK],0);
    Application.Terminate;
  End;
  reg := TRegisty.Create;
  try
    reg.RootKey := HKEY_LOCAL_MACHINE;
    reg.SaveKey('HARDWARE\DEVICEMAP\Scsi',**The File name (String) where you want it saved to**);
    reg.DeleteKey('HARDWARE\DEVICEMAP\Scsi');
    LaunchEXE(**conststring**,'','',False); - shown below
    reg.LoadKey('HARDWARE\DEVICEMAP\Scsi',**The File name (String) where you saved it (same as above)**);
  finally
    reg.closekey;
    reg.Free;
  end;
  ShowMessage('Success'); (*or you can use Successform.show or something similar*)
end;


(* ExeFile is the Exe's Filename, ExePath is the Exe's Path, Params any parameters you wish to pass to the exe *)
(* setting changedir to true will cause the program to change the currentdirectory to the exe's before executing it *)

procedure LaunchExe(ExeFile, ExePath, Params : String; ChangeDir : Boolean);
var
  buffer: array[0..511] of Char;
  TmpStr: String;
  i: Integer;
  StartupInfo:TStartupInfo;
  ProcessInfo:TProcessInformation;
  FErrNo : Integer;
begin

  TmpStr := ExeFile;
  TmpStr := TmpStr +  Params;
  StrPCopy(buffer,TmpStr);

  if ChangeDir and (ExePath <> '') then
  begin
    try
      ChDir(ExePath);
    except
      On E:Exception do raise Exception.Create(E.Message);
    end;
  end;

  FillChar(StartupInfo,Sizeof(StartupInfo),#0);
  StartupInfo.cb := Sizeof(StartupInfo);
  StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
  StartupInfo.wShowWindow := FMode;

  if not CreateProcess(nil, buffer, nil, nil, false, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil,                          nil,                          
    StartupInfo, ProcessInfo) then begin      
    FErrNo := GetLastError();
    raise Exception.Create(GetErrorString);
  end;
end;

   
 

Author

Commented:
hi

thnx for your reply to this topic.

i'm having probs with this code (procedure launchexe to be exact):

  StartupInfo.wShowWindow := FMode;
reason: Undeclared identifier: 'FMode'

    raise Exception.Create(GetErrorString);
reason: Undeclared identifier: 'GetErrorString'

can you tell me what to do to get rig of those errors ??
Hi

I sincerely apologise... I defined that stuff elsewhere and forgot about it...

This should fix it for you:

Replace "GetErrorString" with " 'Error Code: '+InttoStr(FErrNo) "
i.e. raise Exception.Create('Error Code: '+InttoStr(FErrNo));

Replace "FMode" with "SW_SHOWNORMAL"
i.e. StartupInfo.wShowWindow := SW_SHOWNORMAL;

Sorry, I was using that procedure and string to give me greater control of the way it lauched programs from other areas in my application....

Hope this fixes all the errors.

Mainiacfreakus

Author

Commented:
ok. this is the whole code that i've got:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Registry, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    procedure FormShow(Sender: TObject);
  private
    procedure LaunchExe(ExeFile, ExePath, Params : String; ChangeDir : Boolean);
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

const
  exeC : string = 'file.exe';
  plikregC : string = 'backup.reg';

implementation

{$R *.dfm}

procedure TForm1.FormShow(Sender: TObject);
var
  reg : TRegistry;
  plikregV : string;
  exeV : string;

begin
  plikregV := ExtractFilePath(Application.EXEName) + plikregC;
  exeV := ExtractFilePath(Application.EXEName) + exeC;
  If not fileexists(exeV) then
    begin
      Form1.Hide;
      MessageDlg(Format('Error!'#13'The file /s cannot be found!'#13'Please Contact your'+
        ' System Administrator',[exeC]),mtError,[mbOK],0);
      Application.Terminate;
    end;
  Form1.Left := (Screen.Width - Form1.Width);
  Form1.Top := (Screen.Height - Form1.Height);
  Form1.Refresh;
  reg := TRegistry.Create;
  try
    reg.RootKey := HKEY_LOCAL_MACHINE;
    reg.SaveKey('HARDWARE\DEVICEMAP\Scsi',plikregV);
    reg.DeleteKey('HARDWARE\DEVICEMAP\Scsi');
    LaunchEXE(exeV,'','',True);
    reg.LoadKey('HARDWARE\DEVICEMAP\Scsi',plikregV);
  finally
    reg.closekey;
    reg.Free;
  end;
  ShowMessage('Zrobione');
  Application.Terminate;
end;

procedure TForm1.LaunchExe(ExeFile, ExePath, Params : String; ChangeDir : Boolean);
var
  buffer: array[0..511] of Char;
  TmpStr: String;
  StartupInfo:TStartupInfo;
  ProcessInfo:TProcessInformation;
  FErrNo : Integer;

begin
  TmpStr := ExeFile;
  TmpStr := TmpStr +  Params;
  StrPCopy(buffer,TmpStr);

  if ChangeDir and (ExePath <> '') then
  begin
    try
      ChDir(ExePath);
    except
      On E:Exception do raise Exception.Create(E.Message);
    end;
  end;

  FillChar(StartupInfo,Sizeof(StartupInfo),#0);
  StartupInfo.cb := Sizeof(StartupInfo);
  StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
  StartupInfo.wShowWindow := SW_SHOWNORMAL;
  if not CreateProcess(nil, buffer, nil, nil, false, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil,                          nil,
    StartupInfo, ProcessInfo) then begin
    FErrNo := GetLastError();
    raise Exception.Create('Error Code: '+InttoStr(FErrNo));
  end;
end;
end.

and there is something wrong with it because it doesn't save the reg file properly (it makes a 0 bytes file only, so there is no way to bring them back in case of pc hang or sthing)
the deletion of the reg keys is ok (fortunatelly i've made a backup of them before testing)

Author

Commented:
oh and it doesn't wait for the exe file to terminate before continuing execution of the code.
CERTIFIED EXPERT

Commented:
in the var section
   ExitCode : Longword;

if not CreateProcess(nil, buffer, nil, nil, false, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil,                          nil,
    StartupInfo, ProcessInfo) then begin
    FErrNo := GetLastError();
    raise Exception.Create('Error Code: '+InttoStr(FErrNo));
  end else begin
    ExitCode :=1;
    Repeat
         sleep(1000)
    until (Not GetExitCode(ProcessInfo.Handle,ExitCode)) or (ExitCode<>STILL_ACTIVE);


end;

this should wait until the process is killed.  I didnt test the code, but it should be close.

Author

Commented:
still.. it leaves the problem with not saving the reg properly, and that problem is much more important
CERTIFIED EXPERT

Commented:
give me a minute I will test it out (for that case of beer)  :)
Sorry, I had no idea that you wanted the code only to continue execution after the program closed.
This will do it for you:

......
  if not CreateProcess(nil, buffer, nil, nil, false, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil, nil, StartupInfo, ProcessInfo) then begin
    FErrNo := GetLastError();
    raise Exception.Create('Error Code: '+InttoStr(FErrNo));
  end;
  Repeat
    WaitforSingleObject(ProcessInfo.hProcess,INFINITE);
    GetExitCodeProcess(ProcessInfo.hProcess, FErrNo);
  Until FErrNo <> STILL_ACTIVE;
.....

Your code will not work because of the else clause.  The else will only execute the wait if the process failed to start.
I apologise for the mistakes as I have taken this code from a few different programs of mine and put it together to get this to work.  Working on getting the Key to save, but seems to be a Windows problem... :(

Mainiacfreakus

CERTIFIED EXPERT

Commented:
Look at it again.  There is a NOT in front of the CreateProcess so it will only hit the else it it CREATED the process.  I think...
CERTIFIED EXPERT

Commented:
your code will work fine too because of the exception breaking out, but the else would do the same thing.  I didnt notice the raise exception.  

Sorry... the else does need to be there.... my mistake....

My code was badly structured due to copying... thus I did not see the Begin....

Should look like this:

......
  if not CreateProcess(nil, buffer, nil, nil, false, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil, nil, StartupInfo, ProcessInfo) then begin
    FErrNo := GetLastError();
    raise Exception.Create('Error Code: '+InttoStr(FErrNo));
  end
  else Repeat
    WaitforSingleObject(ProcessInfo.hProcess,INFINITE);
    GetExitCodeProcess(ProcessInfo.hProcess, FErrNo);
  Until FErrNo <> STILL_ACTIVE;
.....
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Tested it and the registry saving officially works for me...

Mainiacfreakus

Commented:
1. reg.SaveKey doesnt work under NT OS or i havent gotten it to work it reads the key yes but saves the file as 0bytes
2. underneath is your program in a nutshell it works 100% i checked it 10x
   a. enter EXE name if YES then start
   b. backup reg (and all/every subkey)
   c. delete that key from reg...
   d. run the EXE entered
   c. wait for user to close EXE
   f. restore backup REG (and all/every subkey);

3. Enjoy it took me 4 hours to find a proper way to export the registry and restore it cause there seems to be a problem  
   with delphi's reg.savekey !  so volaa...


Peace Scay7


Your Unit1 >>>
************************
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Shellapi, Registry;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Memo1: TMemo;
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
var
  SEInfo: TShellExecuteInfo;
  ExitCode: DWORD;
  ExecuteFile, StartInString  : string;
  reg : Tregistry;
begin
if key = #13 then
  begin
  if fileexists(edit1.text) then
    begin
    memo1.Lines.Add(formatdatetime('hh:nn:ss >',now)+'File found ['+edit1.text+']');
    shellexecute(
                 handle,
                 'open',
                 'regedit.exe',
                 '/e temp.reg HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi',
                 '',
                 sw_hide
                 );
                 sleep(100);
    if fileexists('temp.reg') then
      begin
      memo1.Lines.Add(formatdatetime('hh:nn:ss >',now)+'Registry backed up.');

        reg := TRegistry.Create;
        try
        reg.RootKey := HKEY_LOCAL_MACHINE;
        reg.DeleteKey('HARDWARE\DEVICEMAP\Scsi');
        memo1.Lines.Add(formatdatetime('hh:nn:ss >',now)+'RegKey Deleted.');
        finally
        reg.closekey;
        reg.free;
        end;

      memo1.Lines.Add(formatdatetime('hh:nn:ss >',now)+'Launching Program...');
      ExecuteFile:= edit1.text;
      startinstring:= edit1.text;
      FillChar(SEInfo, SizeOf(SEInfo), 0);
      SEInfo.cbSize := SizeOf(TShellExecuteInfo);
      with SEInfo do begin
        fMask := SEE_MASK_NOCLOSEPROCESS;
        Wnd := Application.Handle;
        lpFile := PChar(ExecuteFile);
        lpDirectory := PChar(StartInString);
        nShow := SW_SHOWNORMAL;
      end;
      if ShellExecuteEx(@SEInfo) then
      begin
        repeat
        Application.ProcessMessages;
        GetExitCodeProcess(SEInfo.hProcess, ExitCode);
        until (ExitCode <> STILL_ACTIVE) or Application.Terminated;
      memo1.Lines.Add(formatdatetime('hh:nn:ss >',now)+'Program Closed, loop ended...');
      end else
          begin
          showmessage(formatdatetime('hh:nn:ss >',now)+'Unable to launch Program...');
          end;

      shellexecute(
                   handle,
                   'open',
                   'regedit.exe',
                   '/s temp.reg',
                   '',
                   sw_hide
                  );

      memo1.Lines.Add(formatdatetime('hh:nn:ss >',now)+'Registry backup restored...');
      memo1.Lines.Add('');
      memo1.Lines.Add(formatdatetime('hh:nn:ss >>',now)+'Launcher Finished...');
      memo1.Lines.Add('');
      memo1.lines.add('   Another Program By Scay...');
      end else
          begin
          showmessage(formatdatetime('hh:nn:ss >',now)+'Registry not Backed-UP!!!  Closing program...');
          form1.close;
          end;
    end else
        begin
        memo1.Clear;
        showmessage(formatdatetime('hh:nn:ss >',now)+'File not found! Closing Program...');
        form1.close;
        end;
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
if fileexists('temp.reg') then deletefile('temp.reg');
memo1.Clear;
memo1.Lines.Add(formatdatetime('hh:nn:ss >>',now)+'Launcher Start.');
memo1.Lines.Add('');
memo1.Lines.Add(formatdatetime('hh:nn:ss >',now)+'Waiting for input...');
end;

end.
**********************

Your Unit1.dfm file >>>
**********************
object Form1: TForm1
  Left = 404
  Top = 288
  Width = 394
  Height = 219
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Edit1: TEdit
    Left = 8
    Top = 8
    Width = 369
    Height = 21
    TabOrder = 0
    Text = 'Enter EXE name here and press enter...  Eg : c:\test\test.exe'
    OnKeyPress = Edit1KeyPress
  end
  object Memo1: TMemo
    Left = 8
    Top = 40
    Width = 369
    Height = 137
    Lines.Strings = (
      'Memo1')
    TabOrder = 1
  end
end
**********************
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Scay7

Yes, I agree your shellexecute method may be shorter...
however, as I understand it, often on machines where you are not the administrator shellexecute is also blocked and you would need to get the priviledges to run your shellexecute function...
This means that you would have to include the procedure to acquire priviledges anyway...

Mainiacfreakus

Commented:
Ye thats true Mainiacfreakus :P hehe, thats why i copied you code might come in use :P

But for this Thread which he does have priv cause its his own prog unless his going to send it out?
then i would recommend shell idea but both work... so i guess it up to him :P

Thanks for the priv code, will surely use it somewhere :P

Peace Scay7

Author

Commented:
sorry for my absence, but i'm working 16h/day :/

@Mainiacfreakus
tried ur code and this error came up:

      GetExitCodeProcess(ProcessInfo.hProcess, FErrNo);
reason: Types of actual and formal var parameters must be identical


@Scay7
i'll try ur code when i'll get some more time, but i can allready tell that there must be too many changes made to that code for it to run 'my way'
This should work:

define a new variable : "FExitCode : Cardinal" in the LaunchEXE procedure...
then code the code as follows:

....
  Repeat
    WaitforSingleObject(ProcessInfo.hProcess,INFINITE);
    GetExitCodeProcess(ProcessInfo.hProcess, FExitCode);
  Until FExitCode <> STILL_ACTIVE;
....

Mainiacfreakus
(sorry, went away for weekend)

Author

Commented:
tried it and now everything runs great
except of the reg.LoadKey('HARDWARE\DEVICEMAP\Scsi',plikregV);

savekey saves the file in binary format (it would be nice if it was reg text format)
and as i wrote above the proggy doesn't import the keys back to the registry :/

i'll try now with the shellexecute and see what happens
CERTIFIED EXPERT

Commented:
Just a thought.  Not only can shellExecute be blocked but RegEdit or RegEdt32 can be blocked by the system admin in Active Directory.

Author

Commented:
i'll always run the proggy so there is no need to worry about this being blocked

Author

Commented:
ok... right now i have sthing like this:


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Registry, Shellapi;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    procedure Start;
    procedure LaunchExe(ExeFile, ExePath, Params : String; ChangeDir : Boolean);
    function SetPrivilege(sPrivilege: string; bEnabled: Boolean): Boolean;
    procedure FormShow(Sender: TObject);
  private
  public
  end;

var
  Form1: TForm1;

const
  exeC : string = 'file.exe';
  plikregC : string = 'backup.reg';

implementation

{$R *.dfm}

procedure TForm1.Start;
var
  plikregV : string;
  exeV : string;
  temp : string;
  reg : TRegistry;

begin
  plikregV := ExtractFilePath(Application.EXEName) + plikregC;
  exeV := ExtractFilePath(Application.EXEName) + exeC;

  Form1.Left := Screen.Width;
  Form1.Top := Screen.Height;
  Form1.Refresh;

  if not fileexists(exeV) then
    begin
      MessageDlg('Blad!'#13'Plik "'+exeC+'" nie zostal znaleziony!',mtError,[mbOK],0);
      Application.Terminate;
      Application.Destroy;
    end;

  if not SetPrivilege('SeBackupPrivilege',True) then
    begin
      MessageDlg('Blad!'#13'Nie mozna ustawic przywilejow dostepu do rejestru!',mtError,[mbOK],0);
      Application.Terminate;
      Application.Destroy;
    end;

  reg := TRegistry.Create;
  reg.RootKey := HKEY_LOCAL_MACHINE;
  if reg.KeyExists('HARDWARE\DEVICEMAP\Scsi') then
    begin
      reg.closekey;
      reg.Free;
      if fileexists(plikregV) then deletefile(plikregV);
    end
  else
    begin
      reg.closekey;
      reg.Free;
      MessageDlg('Blad!'#13'Wymagane klucze rejestru nie istnieja!',mtError,[mbOK],0);
      Application.Terminate;
      Application.Destroy;
    end;

  reg := TRegistry.Create;
  try
    temp := '/e ' + plikregC + ' HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi';
    shellexecute(handle, 'open', 'regedit.exe', pchar(temp), '', sw_hide);
      repeat
        sleep(100);
      until fileexists(plikregC);
    reg.RootKey := HKEY_LOCAL_MACHINE;
    reg.DeleteKey('HARDWARE\DEVICEMAP\Scsi');
    LaunchEXE(exeV,'','',True);
    temp := '/s ' + plikregC;
    shellexecute(handle, 'open', 'regedit.exe', pchar(temp), '', sw_hide);
  finally
    reg.closekey;
    reg.Free;
  end;

  MessageDlg(exeC + #13#13 + 'Zrobione',mtInformation,[mbOK],0);
  Application.Terminate;
  Application.Destroy;
end;

procedure TForm1.LaunchExe(ExeFile, ExePath, Params : String; ChangeDir : Boolean);
var
  buffer: array[0..511] of Char;
  TmpStr: String;
  StartupInfo:TStartupInfo;
  ProcessInfo:TProcessInformation;
  FErrNo : Integer;
  FExitCode : Cardinal;

begin
  TmpStr := ExeFile;
  TmpStr := TmpStr +  Params;
  StrPCopy(buffer,TmpStr);

  if ChangeDir and (ExePath <> '') then
  begin
    try
      ChDir(ExePath);
    except
      On E:Exception do raise Exception.Create(E.Message);
    end;
  end;

  FillChar(StartupInfo,Sizeof(StartupInfo),#0);
  StartupInfo.cb := Sizeof(StartupInfo);
  StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
  StartupInfo.wShowWindow := SW_SHOWNORMAL;

  if not CreateProcess(nil, buffer, nil, nil, false, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil, nil, StartupInfo, ProcessInfo) then
    begin
      FErrNo := GetLastError();
      MessageDlg(exeC + #13#13'Blad uruchamiania: '+InttoStr(FErrNo),mtError,[mbOK],0);
      Application.Terminate;
      Application.Destroy;
    end
  else
    repeat
      WaitforSingleObject(ProcessInfo.hProcess,INFINITE);
      GetExitCodeProcess(ProcessInfo.hProcess, FExitCode);
    until FExitCode <> STILL_ACTIVE;
end;

function TForm1.SetPrivilege(sPrivilege: string; bEnabled: Boolean): Boolean; (*got this function somewhere - can't remeber where :(*)
var
  hToken: THandle;
  TokenPriv: TOKEN_PRIVILEGES;
  PrevTokenPriv: TOKEN_PRIVILEGES;
  ReturnLength: Cardinal;

begin
  Result := True;
  if not (Win32Platform = VER_PLATFORM_WIN32_NT) then Exit;
  Result := False;
  if OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY, hToken) then
  begin
    try
      if LookupPrivilegeValue(nil, PChar(sPrivilege),
        TokenPriv.Privileges[0].Luid) then
      begin
        TokenPriv.PrivilegeCount := 1;
        case bEnabled of
          True: TokenPriv.Privileges[0].Attributes  := SE_PRIVILEGE_ENABLED;
          False: TokenPriv.Privileges[0].Attributes := 0;
        end;
        ReturnLength := 0;
        PrevTokenPriv := TokenPriv;
        AdjustTokenPrivileges(hToken, False, TokenPriv, SizeOf(PrevTokenPriv),
          PrevTokenPriv, ReturnLength);
      end;
    finally
      CloseHandle(hToken);
    end;
  end;
  Result := GetLastError = ERROR_SUCCESS;
  if not Result then
    raise Exception.Create(SysErrorMessage(GetLastError));
end;

procedure TForm1.FormShow(Sender: TObject);
begin
  Start;
end;

end.


should i expect any surprises from this code ?? (i've checked it a few times and it worked, but who knows ;)
Loadkey will not work unless the registry key does not exist...

Please check that it deletes the reg key correctly... (it works on mine)

Mainiacfreakus

Commented:
Heh to many changes... ?

Download this already compiled version, you just need to run the exe to find out.

htt.p:/./www.uo.co.za/launcher.exe

If you want teh code just post ill zip it quicks

Peace Scay7

Commented:
oh forgot to mention the file that you need to run "file.exe" if my program is in the same dir as the program2 just enter in the box "file.exe" but if the my program is in downloads and the file that your want to run is somewhere else just enter in "c:\somewhere\somewhere\file.exe" with out the ""

Peace Scay7

Author

Commented:
@scay7
i can see how it works from the code, and the idea of my proggy is to compile it for each exe separatelly (i need only 2 of those) and not to type it each time i launch the proggy.

any response from the proggy should be when it finishes or there's an error... and that i have


@Mainiacfreakus
i don't really have time now to check it, but i have a working proggy that does what i want (with shellexecute)

thanks for your help guys
i'll grade this one i a sec
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.