Dream Tech Blog

A person with no dream in life can never live a happy life.
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Using VBScript to edit Registry.

Posted on 2004-05-19 11:49  Dream  阅读(1235)  评论(0编辑  收藏  举报

使用VBScript編輯註冊表, 設定電腦允許ActiveX的才可以! 不知道使用ASP.NET如何寫?

  <script language="VBScript">
   dim hkey_root,hkey_path,hkey_key
   hkey_root="HKEY_CURRENT_USER"
   hkey_path="\Software\Microsoft\Internet Explorer\PageSetup"
    'on error resume next
    Set RegWsh = CreateObject("WScript.Shell")
    hkey_key="\header"   
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"" '//清空頁眉
    hkey_key="\footer"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"" '//清空頁腳
    hkey_key="\margin_top"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.74803" '//19mm
    hkey_key="\margin_bottom"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.74803" '//19mm
    hkey_key="\margin_left"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.74803" '//19mm
    hkey_key="\margin_right"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"0.74803" '//19mm
      
  '//
  </script>