Author Topic: Script to restart MC with Administrator with status of tab before Restart  (Read 31325 times)

AriesTruong

  • Active Member
  • ***
  • Posts: 50
    • View Profile
Hi All,

Now I am fan of MC.
I like to use PortableApps and I also use MC as portable Apps.

I'd like to share one of my scripts about "Restart MC as Administrator role":

Precondition: Download tool nircmd.exe from https://www.nirsoft.net/utils/nircmd.html and copy file file nircmd to folder MC.

Description:
A. Script to Restart MC.
B. Script to restart MC for nircmd tool

How to do:
A. Write script to Restart MC:
  1. Create Multi-Script to restart
  2. Add these lines in to content: 
     @var $nircmdPath = GetTagValue("${mcinstallpath}");
     @var $@scriptFile = $nircmdPath ^ "rebootmc.ncl";
     $nircmdPath = $nircmdPath ^ "nircmd.exe";
     MC.Run CMD="{$nircmdPath}" ARG="script {$scriptFile}" ADMIN

B. Create script to close and restart MC for nircmd.exe:
    1. Create new file with extension .ncl
    2. Add 3 lines:
        closeprocess "~$folder.nircmd$\MultiCommander.exe"
        wait 500
        exec show ~$folder.nircmd$\MultiCommander.exe -T=YourName
    3. Save file with name "rebootmc.ncl


Hope this script can help you.
Aries

« Last Edit: August 05, 2019, 11:26:53 by AriesTruong »
Life changes when we change