我是Windows PowerShell的总noob。 我如何使用psl来调用SHGetKnownFolderPath? 如果我不喜欢Get调用返回的某些值,我还想调用SHSetKnownFolderPath。
I'm a total noob on windows powershell. How can I use psl to call SHGetKnownFolderPath ? I want to then also call SHSetKnownFolderPath if I dont like some of the values back from Get call.
最满意答案
您可以使用P / Invoke。 Lee Holmes 在这里有一个如何从PowerShell中完成这个任务的例子。 这里有一个如何使用SHGetKnownFolderPoath的例子。
或者,您可能只能使用Environment.GetFolderPath :
PS> [Environment]::GetFolderPath('CommonApplicationData') C:\ProgramData您可以通过以下方式获取可用选项的列表:
PS> [Enum]::GetNames([Environment+SpecialFolder])You can use P/Invoke. Lee Holmes has an example of how to do this from PowerShell here. There's an example of how to use SHGetKnownFolderPoath here.
Alternatively, you might just be able to use Environment.GetFolderPath:
PS> [Environment]::GetFolderPath('CommonApplicationData') C:\ProgramDataYou can get the list of available options by the following:
PS> [Enum]::GetNames([Environment+SpecialFolder])更多推荐
发布评论