Skip to content

Instantly share code, notes, and snippets.

@t2psyto
Created June 27, 2013 07:50
Show Gist options
  • Select an option

  • Save t2psyto/5874687 to your computer and use it in GitHub Desktop.

Select an option

Save t2psyto/5874687 to your computer and use it in GitHub Desktop.
一時的にフォルダリダイレクトをする。リダイレクト先を設定してexplorerを再起動。explorerが起動できたら、リダイレクト先を元に戻しておく。 リダイレクト先を記録するレジストリ項目はexplorerが起動するときに読み込まれる。それ以外のタイミングで変更しても次のexplorer再起動時まで影響しない。
taskkill /F /IM explorer.exe
set remotehome=\\server\profile\username
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" /d "%remotehome%\Documents" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Desktop" /d "%remotehome%\Desktop" /f
start explorer
sleep 1
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" /d "%USERPROFILE%\Documents" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Desktop" /d "%USERPROFILE%\Desktop" /f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment