gpt4 book ai didi

powershell - 如何使用powershell调用SHGetKnownFolderPath?

转载 作者:行者123 更新时间:2023-12-03 01:51:07 26 4
gpt4 key购买 nike

我对 Windows powershell 完全是个菜鸟。如何使用 psl 调用 SHGetKnownFolderPath ?如果我不喜欢从 Get 调用返回的某些值,我还想调用 SHSetKnownFolderPath。

最佳答案

您可以使用 P/Invoke。 Lee Holmes 有一个如何通过 PowerShell here 执行此操作的示例。有一个如何使用 SHGetKnownFolderPoath here 的示例.

或者,您可能只能使用Environment.GetFolderPath:

PS> [Environment]::GetFolderPath('CommonApplicationData')
C:\ProgramData

您可以通过以下方式获取可用选项的列表:

PS> [Enum]::GetNames([Environment+SpecialFolder])

关于powershell - 如何使用powershell调用SHGetKnownFolderPath?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16658015/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com