小编Mag*_*Tun的帖子

如何将目录符号链接与 Google Backup and Sync 同步?(或者如何同步不在同步文件夹中的文件?)

在我的计算机上的备份和同步文件夹中,我创建了几个目录符号链接,以便可以在我的谷歌驱动器上备份“真实”位置上的文件。目录符号链接是这样创建的:

mklink /D "C:\Users\Me\Desktop\google\Notepad++" "C:\Users\Me\AppData\Roaming\Notepad++"
Run Code Online (Sandbox Code Playgroud)

这些目录符号链接不会通过 Google Backup and Sync 上传到我的 Google Drive。

有没有办法强制备份和同步上传目录符号链接?如果不是,我如何备份我的一些appdata文件?

我想要一个免费且不涉及第三方的解决方案。

我已经找到了一个带有能够跟踪目录符号链接的 python 脚本的解决方案,但我想要一个更强大的解决方案。

backup sync google-sync symbolic-link

9
推荐指数
2
解决办法
1万
查看次数

将接收参数 On/off 以启动/停止服务的 powershell 修改为检查服务是否打开(或关闭)并停止(或启动)的脚本

我从这里得到了这段代码,它根据收到的参数启动或停止蓝牙服务。

bluetooth.ps1 -BluetoothStatus On
Run Code Online (Sandbox Code Playgroud)

或者

bluetooth.ps1 -BluetoothStatus Off
Run Code Online (Sandbox Code Playgroud)

我想修改它,以便我可以使用简单的 ahk 键绑定在不带参数的情况下调用它:

#b::
Run, C:\Users\user\Desktop\bluetooth.ps1 
return 
Run Code Online (Sandbox Code Playgroud)

然后,脚本应该“自行”检查蓝牙是否打开或关闭,并执行必要的操作来更改状态:如果打开,则应停止蓝牙;如果打开,则应停止蓝牙。如果关闭它应该启动它。

[CmdletBinding()] Param (
    [Parameter(Mandatory=$true)][ValidateSet('Off', 'On')][string]$BluetoothStatus
)
If ((Get-Service bthserv).Status -eq 'Stopped') { Start-Service bthserv }
Add-Type -AssemblyName System.Runtime.WindowsRuntime
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]
Function Await($WinRtTask, $ResultType) {
    $asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
    $netTask = $asTask.Invoke($null, @($WinRtTask))
    $netTask.Wait(-1) | Out-Null
    $netTask.Result
}
[Windows.Devices.Radios.Radio,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
[Windows.Devices.Radios.RadioAccessStatus,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
Await ([Windows.Devices.Radios.Radio]::RequestAccessAsync()) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null …
Run Code Online (Sandbox Code Playgroud)

powershell bluetooth windows-10

2
推荐指数
1
解决办法
1584
查看次数