システムwiki

Checkpoint-コンピュータが時々ハングします

noellap 受付中 最終更新日:2021-05-13 22:26

checkpoint-computerはPowerShellスクリプトで復元ポイントを作成するためのコマンドです.
時には「99%完了」を繰り返します.
誰かが原因を知っていますか?
クイックレミー:コントロールパネルで手動で作る.
スクリプトを使用しないで、常に成功します.
しかし、私は自動的に復元ポイントを作りたいです.


私はchkdsk、disc、sfc、アンチウイルス、消去された復元ポイントとシャドウのコピーをしました、
PowerShell ISEおよびVisual Studioのコードを試してみましたが、ヒントを得ることができませんでした.
だから私は以下のファイルを作りましたが、問題を解決しません.
また、同じ結果を生み出すためのより短い方法があるべきだと思います.
[_RestorePoint.bat]
@set "this=%0%"
@powershell "([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity] :: getCurrent()).IsinRole([Security.Principal.WindowsBuiltinRole] ::管理者)"|/I "TRUE">NUL
@IF ErrorLevel 1(
echo admin、%この%は終了します
出口
)
SET/A "LOOP_COUNT= 0" "" :label_loop
SET/A "LOOP_COUNT=%LOOP_COUNT%+ 1"
@IF%LOOP_COUNT%GTR 3(
echoタイムアップ、失敗したときに失敗する
goto label_end

)
PowerShellC:\TMP\_RestedAte.ps1|find/i "new"
%ERRORLEVEL%EQU 0 goto label_end

Reg Importc:\tmp\_permitrestoretime.reg
TaskKill/F/F/Fi "ImageName EQ PowerShell.exe"/fi "WindowTitle EQ管理者:exingRestorePoint"
"RectionRestorePoint"/Realtime PowerShell-executionpolicy Uncextricted-OutputFormat XML-WindowStyleの最小化-コマンド "checkpoint-computer-description 'daily'-restoropointType 'modify_settings'"
タイムアウト1800>NUL
TaskKill/F/F/Fi "ImageName EQ PowerShell.exe"/fi "WindowTitle EQ管理者:exingRestorePoint"
goto label_loop
:label_end
PowerShell Get-ComputerRestorePoint
出口
[EOF]
[_Restedate.ps1]
$ currentUser= new-object security.principal.WindowsPrincipal $([Security.Principal.WindowsIdentity] :: getCurrent()) $ TestResult= $ currentUser.isinrole([Security.Principal.WindowsBuiltinRole] ::管理者)::管理者) if($ testresult-eq $ false){
echo "NOT admin"
出口
}
$ targettime=(get-date).addminutes(-30)
$ TS= $ targettime.toString( "mm/dd/yyyy hh:mm")
$ A= GET-ComputerRestorePoint|Select-Object CreateTime
foreach($ aの$ b){
$ C= $ B.CreationTime
$ D= $ C.TOSTRING()
$ E= $ DSSTRING(0,14)
$ f= $ E + '-00:00'#utc
$ g= [DateTime] :: ParSeexact($ f、 'yyyymmddhhmmsszzz'、$ null)
$ gs= $ g.tostring( "mm/dd/yyyy hh:mm")
($ g-gt $ targettime)の場合{
書き込み出力$(「新しい復元ポイント: '+ $ GS +」>今-30分:' + $ TS)
} else {
書き込み出力$( '旧復元ポイント:' + $ GS + '<=今-30min:' + $ TS)
}
}
[EOF]
[_permitrestoretime.reg]
Windowsレジストリエディタversion5.00
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\SystemRestore]
"SystemRestorePointCreationFrequency"= dword:00000001
[EOF]

返信リスト(回答:1)

1 #
IgorLey
こんにちはノエル、
ノミネーション.だから私は十分に深いWindowsの知識を持っています、そしてあなたは私を信頼するかもしれません.他の人を助けることは私にとって喜びであり、私はあなたを助けるために最善を尽くします.
Q&Aフォーラムでこのような質問をする方が効果的ですhttps://docs.Microsoft.com/ja-jp/answers/index....
これは、管理者と企業ユーザー、およびこのフォーラムを対象としています.ホームユーザーを対象としているため、地元の専門家が対応するknowlEdgeがありません.申し訳ありません.