Topic: Offline SFC Scans  (Read 3242 times)

Offline SFC Scans
« on: January 01, 2019, 08:31:09 AM »

bob.omb

  • Code Baker
  • Grand Chef
  • *****
  • Location: USA
  • Date Registered: Jul 2017
  • Posts: 1261
Anyone want to help make an SFC wrapper for offline repairs from PE? (In 10PE this works on 7 through 10 hosts)

Super basic thrown together CMD version attached.

This needs to be done regularly at tech shops..

Code: [Select]
@Echo Off
:BEGIN
CLS
ECHO                              Offline SFC Repair
ECHO -----------------------------------------------------------------------------
ECHO.
SET /P DEFAULT="Scan default offline Windows Installation? [Y/N] : "
IF /I "%DEFAULT%" EQU "Y" GOTO DEFAULTLOCATION
:SETLOCATION
ECHO. && SET /P DRIVELETTER="Enter the drive letter of a Windows Installation (e.g. D, E, F): "
ECHO.
IF NOT EXIST %DriveLetter%:\Windows GOTO NOTDETECTED
SET /P BOOT="Would you like to specifiy a different boot location? [Y/N] :"
ECHO.
IF /I "%BOOT%" EQU "Y" GOTO SETBOOTLOCATION
SET DRIVELETTER2=%Driveletter%
GOTO REPAIR
:SETBOOTLOCATION
SET /P DRIVELETTER2="Enter the drive letter of the boot partition (e.g. D, E, F): "
IF NOT EXIST %DriveLetter2%:\ ECHO. && ECHO Boot Partition does not exist! && ECHO. && ECHO. && PAUSE && GOTO BEGIN
GOTO REPAIR
:DEFAULTLOCATION
IF EXIST C:\WINDOWS (
SET DRIVELETTER=C
SET DRIVELETTER2=C
)
:REPAIR
IF NOT EXIST %DriveLetter%:\Windows (
GOTO NOTDETECTED
)
CLS
ECHO                              Offline SFC Repair
ECHO ------------------------------------------------------------------------------
ECHO.
ECHO  [**Offline Boot Directory*****] = %DriveLetter2%:\
ECHO.   
ECHO  [**Offline Windows Directory**] = %DriveLetter%:\Windows
ECHO.
SFC /SCANNOW /OFFBOOTDIR=%DriveLetter2%:\ /OFFWINDIR=%DriveLetter%:\Windows /OFFLOGFILE=%UserProfile%\Desktop\sfclog.txt
ECHO.
ECHO.
PAUSE
EXIT
:NOTDETECTED
CLS
ECHO                              Offline SFC Repair
ECHO ------------------------------------------------------------------------------
ECHO.
ECHO No Windows Installation detected @ %DriveLetter%:\
ECHO.
ECHO.
PAUSE
GOTO BEGIN
EXIT

* OfflineSFC.zip (0.71 kB - downloaded 142 times.)

If not I'll do it on my own, slowly  :lol:
« Last Edit: January 01, 2019, 08:59:19 AM by bob.omb »

Re: Offline SFC Scans
« Reply #1 on: January 01, 2019, 08:58:16 AM »

bob.omb

  • Code Baker
  • Grand Chef
  • *****
  • Location: USA
  • Date Registered: Jul 2017
  • Posts: 1261
I fixed it a little bit. It does work but is ugly, logfile placed on desktop can be checked during process...   Maybe we can output SFC log into into a window so we can watch the process + a logfile... That would make it the first time you could actually watch sfc do its thing...

For failed repairs maybe we can have it auto parse filenames from log out of lines with the word "corrupt", and offer to copy them manually from a win install iso, this is what I do myself when an SFC repair fails.  It is normally not worth the extra time (if repairs fail), but if we can automate it, it will be better\faster than re-installing...
« Last Edit: January 01, 2019, 03:25:00 PM by bob.omb »

Re: Offline SFC Scans
« Reply #2 on: January 01, 2019, 04:21:41 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
very small thing:
better check system file to detect windows

eg.
Code: [Select]
IF NOT EXIST %DriveLetter%:\Windows\System32\config\SYSTEM GOTO NOTDETECTED
:turtle:

Edit:
not tested but MAYBE you can get \Windows\ folder name with something like this
%DriveLetter%:\*\System32\config\SYSTEM GOTO Detected_FindWinFolder
« Last Edit: January 01, 2019, 04:23:44 PM by Lancelot »

Re: Offline SFC Scans
« Reply #3 on: January 01, 2019, 07:01:22 PM »

bob.omb

  • Code Baker
  • Grand Chef
  • *****
  • Location: USA
  • Date Registered: Jul 2017
  • Posts: 1261
Simple plugin created.

Offline SFC Repair: * OfflineSFC_Plugin_v1.7z (45.81 kB - downloaded 111 times.)

Re: Offline SFC Scans
« Reply #4 on: January 02, 2019, 03:10:09 AM »

bob.omb

  • Code Baker
  • Grand Chef
  • *****
  • Location: USA
  • Date Registered: Jul 2017
  • Posts: 1261
Updated Plugin to v2

Now includes a Real-Time status window, showing SFC progress.

ila_rendered

*The status window can be closed at any time without affecting the Scan/Repair process

-----

ila_rendered

Offline SFC Repair v2: * OfflineSFC_Plugin_v2.7z (48.18 kB - downloaded 131 times.)
« Last Edit: January 02, 2019, 03:39:13 AM by bob.omb »

Re: Offline SFC Scans
« Reply #5 on: January 03, 2019, 02:10:41 PM »

dazza

  • Chef
  • ***
  • Date Registered: Jan 2017
  • Posts: 244
Hi

Great work

Any chance of a plugin for Win10XPE as well?

Tried using this one but get error:

Unable to create directory:  [DirMake,%ProjectTemp%\TempExtractFolder\%containerfolder%]

Re: Offline SFC Scans
« Reply #6 on: January 04, 2019, 12:17:11 AM »

bob.omb

  • Code Baker
  • Grand Chef
  • *****
  • Location: USA
  • Date Registered: Jul 2017
  • Posts: 1261
I have a good arrangement (i hope  :lol:) where I'll write a plugin for SE and let the XPE masters do their thing..(conversion or re-create)

My view for my personal plugins is this(For future reference): If I made the plugin from scratch, like this one, no credit is necessary if converting for another project.  I just like to see it available for all.  (I used to care to be seen as contributing, but at this stage it does not matter to me personally anymore)  Otherwise the only time I personally care about credit is if others were involved in development.. For recognition/history..

Hopefully there will be an XPE version soon  :thumbsup:
« Last Edit: January 04, 2019, 12:25:35 AM by bob.omb »

Re: Offline SFC Scans
« Reply #7 on: January 05, 2019, 03:42:56 AM »

bob.omb

  • Code Baker
  • Grand Chef
  • *****
  • Location: USA
  • Date Registered: Jul 2017
  • Posts: 1261
Request: Can someone please make a XPE plugin for Dazza  :lol: 

Required for the plugin are 3 files, OfflineSFC.cmd, OfflineSFC.ico, and tail.exe

I would be fine with another take on this (CMD rewritten) in the interest of progress...  :wink: (although conversion is an easier request)
« Last Edit: January 05, 2019, 03:43:41 AM by bob.omb »

Re: Offline SFC Scans
« Reply #8 on: January 05, 2019, 05:17:55 AM »

James

  • Grand Chef
  • *****
  • Location: USA
  • Date Registered: Dec 2017
  • Posts: 2272
Yes Bob, now get back to work...

Edit
Bob, this should do it - attachment all yours from this point..
« Last Edit: January 05, 2019, 05:56:38 AM by James, Reason: attachment »

Re: Offline SFC Scans
« Reply #9 on: January 05, 2019, 06:58:33 AM »

bob.omb

  • Code Baker
  • Grand Chef
  • *****
  • Location: USA
  • Date Registered: Jul 2017
  • Posts: 1261
Thanks James  :thumbsup:

Perhaps I should have included SFC as a dependency in my version   :w00t:  I cant stop laughing at this.. This is my smile of the day @Lancelot  :lol: (http://theoven.org/index.php?topic=2693.msg30528#msg30528)

ila_rendered

ila_rendered

OfflineSFC Plugin v3:  * OfflineSFC_SE_Plugin_v3.7z (48.28 kB - downloaded 127 times.)

« Last Edit: January 05, 2019, 07:00:18 AM by bob.omb »

Re: Offline SFC Scans
« Reply #10 on: January 05, 2019, 12:45:58 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Hi Bob.Omb

Sorry for disrupting "Offline SFC Scans" topic a lot.
I just split topic
http://theoven.org/index.php?topic=2697
and attached "before split" to reply 2.

See you on next post....

Re: Offline SFC Scans
« Reply #11 on: January 05, 2019, 12:50:35 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Hi Bob.Omb

Added to server with minor fixes,
-> I believe you do not need sfc.exe at SysWOW64 but you need sfc.exe at System32  :wink:
Edit: If I am wrong enable line //Set,%PluginArch%,x86 --> current Version=004 Date=2019.01.05_16:02.13 (GMT0: -3 Hours)

Call,DownloadX,"%BaseDir%\Projects\Yomi\AppY\System Tools\OfflineSFC.Script"
http://theoven.org/index.php?topic=2672.0

further on your hands.

*
Utils\PC Packed
There is option:
Add 'Run from System32'

to create such cmd things at sytem32 it is faster to use 'Run from System32' and will have better results using variables....

I also do same as you do, I hide scrollbox and 'Run from System32' checkbox after creation.  :wink:

:turtle:

See Edit:
« Last Edit: January 05, 2019, 01:04:05 PM by Lancelot »

Re: Offline SFC Scans
« Reply #12 on: January 05, 2019, 12:54:09 PM »

dazza

  • Chef
  • ***
  • Date Registered: Jan 2017
  • Posts: 244
Yes Bob, now get back to work...

Edit
Bob, this should do it - attachment all yours from this point..
Thank you very much for this - much appreciated  :thumbsup:

Re: Offline SFC Scans
« Reply #13 on: January 05, 2019, 11:45:48 PM »

bob.omb

  • Code Baker
  • Grand Chef
  • *****
  • Location: USA
  • Date Registered: Jul 2017
  • Posts: 1261
-> I believe you do not need sfc.exe at SysWOW64 but you need sfc.exe at System32  :wink:

Set,%PluginArch%,x86 - puts files in BOTH System32 and SysWOW64 correct?   Not sure if this is needed but the files are small.  I wonder if SFC in SysWOW64 is used by the x64 SFC from System32 while its checking 32bit files in SysWOW64 on host os?  I am not 100% sure yet..
« Last Edit: January 05, 2019, 11:47:21 PM by bob.omb »

Re: Offline SFC Scans
« Reply #14 on: January 06, 2019, 02:42:32 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Hi bob.omb

Just test plugin on server to see if "tail.exe" working as you design or not ?
Your reply will clear all relevant things about System32 and SysWOW64, and I will respond to your questions when I get back home.  :great:

:turtle:

 

Powered by EzPortal