فهرست منبع

log pinonedrivetohome to public dir

Tobias Simetsreiter 2 سال پیش
والد
کامیت
d0c44c886f
1فایلهای تغییر یافته به همراه9 افزوده شده و 1 حذف شده
  1. 9 1
      bin/pinonedrivetohome.bat

+ 9 - 1
bin/pinonedrivetohome.bat

@@ -13,12 +13,20 @@ goto:eof
 #>
 # here start your powershell script
 
+# Add The Script to the following Registry key (comma separated list of commands to run on login):
+# Get-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AppSetup
+
 $o = new-object -com shell.application
 
-$logfile = $env:TEMP + '\pinonedrivetohome.log'
+$logdir = Join-Path -Path $env:PUBLIC "TEMP/pinonedrivetohome"
+
+New-Item -ItemType Directory -Path $logdir -Force
+
+$logfile = Join-Path -Path $logdir ($env:USERNAME + '.log')
 $logfile
 
 &{
+
     $onedrive = '\\tsclient\C\Users\'+$env:USERNAME+'\OneDrive - Wabtec Corporation'
     $sharepoint = '\\tsclient\C\Users\'+$env:USERNAME+'\Wabtec Corporation'
     $shortcuts = '\\ang-fs.wabtec.com\share\95 RDS Shortcuts'