Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

About Shell.Execute

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • About Shell.Execute

    I want to register an OCX after install,so I write the script like that
    Shell.Execute("%SystemFolder%//regsvr32","OPEN","%AppFolder%//ocx//a.ocx")
    but it don't recognize the "%AppFolder%//ocx//a.ocx".because the %AppFoler% now is "c:\program files",
    so what can i do ?
    I tried using the sessionvar.expand,but I failed.

    best regard.

  • #2
    Variables have to be expanded first,
    http://support.indigorose.com/index....0Factory%207.0
    I hope this would help.

    Comment


    • #3
      qiuwen777,

      Try something like this:

      RegSvr = SessionVar.Expand("%SystemFolder%\\regsvr32.exe");
      F_Name = SessionVar.Expand("%AppFolder%\\ocx\\a.ocx");

      Shell.Execute(RegSvr,"OPEN",F_Name);

      Or you can perform the expand option within the action like this:

      Shell.Execute(SessionVar.Expand("%SystemFolder%\\r egsvr32.exe"),"OPEN",SessionVar.Expand("%AppFolder %\\ocx\\a.ocx"));

      But I think the first method is more readable to the developer.

      Adam Kapilik

      Comment


      • #4
        Adam

        I just tried like that

        RegSvr = SessionVar.Expand("%SystemFolder%\\regsvr32.exe");
        F_Name = SessionVar.Expand("%AppFolder%\\ocx\\a.ocx");

        Shell.Execute(RegSvr,"OPEN",F_Name);

        but error

        " Argument 3 must be of type string "

        so how to ?

        thank you.

        Comment


        • #5
          I just tested this exact code:

          RegSvr = SessionVar.Expand("%SystemFolder%\\regsvr32.exe");
          F_Name = SessionVar.Expand("%AppFolder%\\ocx\\a.ocx");

          Shell.Execute(RegSvr, "open", F_Name, "");

          And it seems to be calling regsvr32.exe properly.

          Adam Kapilik

          Comment


          • #6
            Yes - double check what you've typed there. If it still doesn't work, copy and paste the exact script here onto the forum so we can see what is going on.

            It sounds like a typo on your side.
            AutoPlay Media Studio 8.5 is Windows 10 compatible today!

            Comment


            • #7
              I'm sorry to bother you again.but it still don't work properly.So I came here again.

              I have checked my script again,and just use Adam's code.

              RegSvr = SessionVar.Expand("%SystemFolder%\\regsvr32.exe");
              F_Name = SessionVar.Expand("%AppFolder%\\CoolButton.ocx");

              Shell.Execute(RegSvr,"OPEN",F_Name);

              There ,F_Name is "C:\Program Files\CoolButton.ocx",

              when Regsvr32 are registering, an error occured,because regsvr32 can't find the properly module "c:\program"

              I guest maybe F_NAME contain a blank char,that it isn't recognized properly,
              so I just use the Code like below

              Shell.Execute(RegSvr,"OPEN","C:\Program Files\CoolButton.ocx");

              The same error occured.

              thank you .Wish to get your help.

              PS,my OS is WinXp Pro(Simplified Chinese).

              Comment


              • #8
                Try this line instead:

                Shell.Execute(RegSvr,"OPEN","C:\\Program Files\\CoolButton.ocx");
                AutoPlay Media Studio 8.5 is Windows 10 compatible today!

                Comment


                • #9
                  I just used again.

                  Failed again.

                  Comment


                  • #10
                    Originally posted by qiuwen777
                    I just used again.

                    Failed again.
                    Can't you use Setup Factory's internal action of "Register DLL"? It should work with OCX's too...

                    Comment


                    • #11
                      Originally posted by Waza04
                      Can't you use Setup Factory's internal action of "Register DLL"? It should work with OCX's too...
                      I can't do that like what you said,because the ocx file is dependent on other files.

                      Comment

                      Working...
                      X