Windows 7登录脚本 [英] windows 7 login script

查看:211
本文介绍了Windows 7登录脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在用户配置文件中使用此登录脚本来映射网络驱动器.它对XP甚至Vista,Windows 7都适用.如果我在登录时手动运行它,则可以正常工作.有谁知道我在做什么错....:confused:

显式选项
昏暗的objNetwork,strRemotePath1,strRemotePath2,strRemotePath3
昏暗的strDriveLetter1,strDriveLetter2,strDriveLetter3

strDriveLetter1 ="G:"
strDriveLetter2 ="R:"
strDriveLetter3 ="T:"
strRemotePath1 ="\\ stormwind \ group"
strRemotePath2 ="\\ stormwind \ ITD"
strRemotePath3 ="\\ stormwind \ JDLInfo"

设置objNetwork = CreateObject("WScript.Network")

''映射驱动器G:和R:和T:
的部分 objNetwork.MapNetworkDrive strDriveLetter1,strRemotePath1
objNetwork.MapNetworkDrive strDriveLetter2,strRemotePath2
objNetwork.MapNetworkDrive strDriveLetter3,strRemotePath3


Wscript.Quit

I use this logon script in the user profile to map network drives. It works great for XP even Vista, Windows 7 not so much. If I run this manually at login it works fine. does anyone know what im doing wrong....:confused:

Option Explicit
Dim objNetwork, strRemotePath1, strRemotePath2, strRemotePath3
Dim strDriveLetter1, strDriveLetter2, strDriveLetter3

strDriveLetter1 = "G:"
strDriveLetter2 = "R:"
strDriveLetter3 = "T:"
strRemotePath1 = "\\stormwind\group"
strRemotePath2 = "\\stormwind\ITD"
strRemotePath3 = "\\stormwind\JDLInfo"

Set objNetwork = CreateObject("WScript.Network")

'' Section which maps drives, G: and R:, and T:
objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1
objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2
objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3


Wscript.Quit

推荐答案

这听起来像是UAC问题.登录脚本以管理员身份运行(使用管理访问令牌).登录后,未提升的操作将使用标准访问令牌运行,因此无法看到映射的驱动器.

有三种潜在的解决方案:

1)禁用UAC(真的不推荐).

2)Microsoft在http://support.microsoft.com/default.aspx/kb/937624列出了解决此问题的解决方法.此解决方法确实会带来安全风险,但远不及禁用UAC一样严重.

3)可以使用组策略首选项而不是登录脚本来映射驱动器.
This sounds like a UAC issue. Logon scripts run as administrator (using an administrative access token). After login, un-elevated actions run with a standard access token, so cannot see the mapped drives.

There are three potential solutions:

1) Disable UAC (really NOT recommended).

2) Microsoft lists a workaround at http://support.microsoft.com/default.aspx/kb/937624 that addresses this issue. This workaround does pose a security risk, but nowhere near as bad as disabling UAC.

3) The drives could be mapped using Group Policy Preferences instead of a login script.


这篇关于Windows 7登录脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆