SFC button

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Damel
Member
Member
Posts: 130
Joined: 2003-02-06, 01:11 UTC
Location: Prague, Czech Republic

SFC button

Post by *Damel »

Hi, please is there a way to make button in bar with command: SFC /scannow ? (Windows 7 SP1 x64)

Thanks

PS:
I want button with, maybe BAT file, with this or similar functionality:
sfc.exe /scannow
findstr /c:"[SR]" %windir%\logs\cbs\cbs.log >%userprofile%\Desktop\sfcdetails.txt
@ECHO Off
COLOR 0C
ECHO Finish!
PAUSE
The best solution:
1. format C:
2. install TotalCmd
3. install Windows (optionally)
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Re: SFC button

Post by *karlchen »

Hello, Damel.
is there a way to make button in bar with command: SFC /scannow ? (Windows 7 SP1 x64)
Yes, there is.

Inside T.C. 8.01 press <F1>.
Then go to Configuration => Change Buttonbar => Configuration - Change Buttonbar.
The next page will be "Dialog box: Configuration - Change button bar"
Everything which you need to know about creating a button that calls a batch file in elevated administrator mode can be found in the help page.

So there is really nothing stopping you from achieving your goal.

Kind regards,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 11.50 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
Damel
Member
Member
Posts: 130
Joined: 2003-02-06, 01:11 UTC
Location: Prague, Czech Republic

Post by *Damel »

Thank you karlchen for your advices. I know, it looks easily, but... I wrote my post after 2 days of unsuccessful experimenting (and yes, with Help "in my hands").

My only success is this:
- create link for my BAT file
- set "Run as administrator" in properties of this LNK file
- and run this LNK from Windows Explorer (*heresy!* :) )
But I want run this (sfc /scannow) from TC.
The best solution:
1. format C:
2. install TotalCmd
3. install Windows (optionally)
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, damel.

The most important sentence in the help page mentioned in my previous post is this
1. You may specify the program to be run, including its search path. You can also specify fixed parameters here. Important: You must give the extensions .com and .bat, because by default Windows only finds .exe! With "Change >>" and "Insert file name" you can search for the desired program. Put an asterisk '*' in front of the name to start it with administrative rights.
Bold formatting done by me.
  • Given: your script

    Code: Select all

    sfc.exe /scannow 
    findstr /c:"[SR]" %windir%\logs\cbs\cbs.log >%userprofile%\Desktop\sfcdetails.txt 
    @ECHO Off 
    COLOR 0C 
    ECHO Finish! 
    PAUSE
  • Assumption: Name of script and folder where it has been stored:
    (Adapt to match the real names)
    Scriptname: sfcnow.cmd
    Folder: D:\Utils\Scripts
  • Steps to create the T.C. button:
    1. Launch Total Command 8.01 x64
    2. Click Configuration => Buttonbar => Button [Add]
    3. Enter the following values:
      Command: *D:\Utils\Scripts\sfcnow.cmd
      Parameters: (leave empty)
      Startpath: D:\Utils\Scripts
      Icon file: (select icon of sfc.exe e.g.) using button [>>]
      Icon: 0
      Tooltip: Launch SFC /SCANNOW
      Note:
      Adapt the given sample names to match your real names.
    4. Done.
HTH,
Karl
Last edited by karlchen on 2012-12-27, 15:48 UTC, edited 4 times in total.
MX Linux 21.3 64-bit xfce, Total Commander 11.50 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
Damel
Member
Member
Posts: 130
Joined: 2003-02-06, 01:11 UTC
Location: Prague, Czech Republic

Post by *Damel »

This is it!: "x64" (my TC is/was 32 bit)
I knew I missed something, but... so big difference between 32 and 64 bit versions of TC? No way...

karlchen you are a great guy! Thank you!

PS: But still, is there any way how to make it on 32 bit TC? Because for one thing run new one instance of TC (x64) isn't just practical (32 bit TC needed for some old plugins). Or is it part of limitations listed in your other useful post here: http://ghisler.ch/board/viewtopic.php?p=249098#249098
The best solution:
1. format C:
2. install TotalCmd
3. install Windows (optionally)
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, Damel.

The differences between running T.C. x86 and running T.C. x64 running on a Windows x64 can be found here: Windows x64: Explorer vs TC: Content of System32 different.

I.e. T.C. 8.01 x86 will have to apply some dirty little tricks in order to workaround some dirty little tricks played upon 32-bit processes by the WoW64 subsystem.

Anyway, your goal can be achieved on Windows 7 SP1 x64 even though you are using T.C. 8.01 x86.
  • Given: your script

    Code: Select all

    sfc.exe /scannow 
    findstr /c:"[SR]" %windir%\logs\cbs\cbs.log >%userprofile%\Desktop\sfcdetails.txt 
    @ECHO Off 
    COLOR 0C 
    ECHO Finish! 
    PAUSE
  • Assumption: Name of script and folder where it has been stored:
    (Adapt to match the real names)
    Scriptname: sfcnow.cmd
    Folder: D:\Utils\Scripts
  • Steps to create the T.C. button:
    1. Launch Total Command 8.01 x86
    2. Click Configuration => Buttonbar => Button [Add]
    3. Enter the following values:
      Command: *C:\Windows\SysNative\cmd.exe /c D:\Utils\Scripts\sfcnow.cmd
      Parameters: (leave empty)
      Startpath: D:\Utils\Scripts
      Icon file: (select icon of sfc.exe e.g.) using button [>>]
      Icon: 0
      Tooltip: Launch SFC /SCANNOW
      Note:
      Adapt the given sample names to match your real names.
    4. Done.
HTH,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 11.50 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
Damel
Member
Member
Posts: 130
Joined: 2003-02-06, 01:11 UTC
Location: Prague, Czech Republic

Post by *Damel »

That's brilliant and so simply! Thank you karlchen, you really helped me to understand how it works. Happy new year to Germany!
The best solution:
1. format C:
2. install TotalCmd
3. install Windows (optionally)
Post Reply