SHARE
TWEET

VncAddressBook vbs

a guest Feb 28th, 2012 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim WSHShell
  2. Dim MyDocuments
  3.  
  4. Set oNetList = GetObject ( "WinNT:" )
  5. Set WSHShell = WScript.CreateObject("WScript.Shell")
  6.  
  7. MyDocuments = WSHShell.SpecialFolders("MyDocuments")
  8.  
  9. for each oNet in oNetList
  10.     for each oComp in oNet
  11.         if oComp.Class = "Computer" Then
  12.             CreateConfig(lcase(oComp.Name))
  13.         end if
  14.     next
  15. next
  16.  
  17. Sub CreateConfig(ServerHostName)
  18.         Dim fso, tf
  19.         Set fso = CreateObject("Scripting.FileSystemObject")
  20.  
  21.         strDirectory = MyDocuments & "\VncAddressBook\"
  22.  
  23.         If NOT fso.FolderExists(strDirectory) Then
  24.                 fso.CreateFolder(strDirectory) 
  25.         End If
  26.  
  27.         Set tf = fso.CreateTextFile(strDirectory & ServerHostName & ".vnc", True)
  28.  
  29.         tf.WriteLine("[connection]")
  30.         tf.WriteLine("host=" & ServerHostName)
  31.         tf.WriteLine("port=5900")
  32.         tf.WriteLine("[options]")
  33.         tf.WriteLine("use_encoding_0=1")
  34.         tf.WriteLine("use_encoding_1=0")
  35.         tf.WriteLine("use_encoding_2=1")
  36.         tf.WriteLine("use_encoding_3=0")
  37.         tf.WriteLine("use_encoding_4=1")
  38.         tf.WriteLine("use_encoding_5=1")
  39.         tf.WriteLine("use_encoding_6=1")
  40.         tf.WriteLine("use_encoding_7=1")
  41.         tf.WriteLine("use_encoding_8=1")
  42.         tf.WriteLine("use_encoding_9=1")
  43.         tf.WriteLine("use_encoding_10=0")
  44.         tf.WriteLine("use_encoding_11=0")
  45.         tf.WriteLine("use_encoding_12=0")
  46.         tf.WriteLine("use_encoding_13=0")
  47.         tf.WriteLine("use_encoding_14=0")
  48.         tf.WriteLine("use_encoding_15=0")
  49.         tf.WriteLine("use_encoding_16=1")
  50.         tf.WriteLine("preferred_encoding=5")
  51.         tf.WriteLine("restricted=0")
  52.         tf.WriteLine("viewonly=0")
  53.         tf.WriteLine("nostatus=0")
  54.         tf.WriteLine("nohotkeys=0")
  55.         tf.WriteLine("showtoolbar=1")
  56.         tf.WriteLine("AutoScaling=0")
  57.         tf.WriteLine("fullscreen=0")
  58.         tf.WriteLine("autoDetect=0")
  59.         tf.WriteLine("8bit=1")
  60.         tf.WriteLine("shared=1")
  61.         tf.WriteLine("swapmouse=0")
  62.         tf.WriteLine("belldeiconify=0")
  63.         tf.WriteLine("emulate3=0")
  64.         tf.WriteLine("emulate3timeout=100")
  65.         tf.WriteLine("emulate3fuzz=4")
  66.         tf.WriteLine("disableclipboard=0")
  67.         tf.WriteLine("localcursor=2")
  68.         tf.WriteLine("Scaling=0")
  69.         tf.WriteLine("scale_num=1")
  70.         tf.WriteLine("scale_den=1")
  71.         tf.WriteLine("cursorshape=0")
  72.         tf.WriteLine("noremotecursor=0")
  73.         tf.WriteLine("compresslevel=6")
  74.         tf.WriteLine("quality=6")
  75.         tf.WriteLine("ServerScale=1")
  76.         tf.WriteLine("EnableCache=0")
  77.         tf.WriteLine("QuickOption=2")
  78.         tf.WriteLine("UseDSMPlugin=0")
  79.         tf.WriteLine("UseProxy=0")
  80.         tf.WriteLine("DSMPlugin=")
  81.         tf.Close
  82. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top