Announcement

Collapse
No announcement yet.

Problem with Run As Administratior CMD Command

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

  • Problem with Run As Administratior CMD Command

    Hello
    I'm using Setup Factory 9.5.3
    I want to run CMD Command As Administrator Before Installing. I know how to using "File.Run" method. but I don't know how to make code for run as administrator.
    My CMD Command is : Bcdedit.exe -set TESTSIGNING ON
    Please Help and Guid Me.
    Thanks A Lot.

  • #2
    If you use File.Run() to execute the command, it will run "as administrator", as long as your setup is manifested to request admin rights when started, which is the default.

    Click image for larger version  Name:	image.png Views:	1 Size:	26.8 KB ID:	310491

    Ulrich

    Comment


    • #3
      Thanks Ulrich But it's not working.
      I put my command to "bat" file and used File.Run() to open the bat file but it doesn't work.

      Code:
      result = File.Run(SessionVar.Expand("%AppFolder%\\Testmode.bat"), "", "", SW_SHOWNORMAL, false);
      Click image for larger version

Name:	Testmode.jpg
Views:	63
Size:	36.0 KB
ID:	310493

      Comment


      • #4
        If it is not working, then you are doing something wrong.

        Design:

        Click image for larger version

Name:	SCRN-2023-07-06-02.png
Views:	53
Size:	18.9 KB
ID:	310495

        Runtime:

        Click image for larger version

Name:	SCRN-2023-07-06-01.png
Views:	49
Size:	64.5 KB
ID:	310496

        If you have a license for Setup Factory, please associate your forum user name with your customer account (this can be done in the Customer Portal). You can also provide your serial number via the contact form. If you have a license, I am happy to help further, once the information you sent was confirmed.

        Ulrich

        Comment

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎