title: Need Assistance with VBSCRIPT to capture screenshots of user's desktop
body: <p>I am a novice when it comes to object oriented program.  That said, I have been trying to construct a vbscript that will capture a screenshot of the desktop and immediately save it to a folder I specify.   Here is the code I have so far:</p>
  
  <p>' START</p>
  
  <pre><code> Dim screenSize 
  
   screenSize = New screenSize.Size(Screen.PrimaryScreen.Bounds.X,Screen.PrimaryScreen.Bounds.Y)
  
   Dim screenGrab
  
   screenGrab = New screenGrab.Bitmap(My.Computer.Screen.Bounds.Width,   my.Computer.Screen.Bounds.Height)
  
   Dim g 
  
   g = g.System.Drawing.Graphics.FromImage(screenGrab)
  
   dim copyS
  
   copyS = Graphics.CopyPixels4.PaintEventArgs
  
   dim copyS2
  
   copyS2 = copyS.Graphics.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation)
  
   dim saveTo
  
   saveTo = screenGrab.Save("C:\temp\screenGrab.bmp")
  </code></pre>
  
  <p>' END</p>
  
  <p>I prefer to keep this in VBSCRIPT as this script will be incorporated into an existing vbscript I created.  I currently get an error at line 3 stating "class not defined 'screensize".  I am also concerned that even if I fix the error at line 3 I may run into other syntax issues afterward.  The overall intent of the script is to 1) get the screen dimensons ; 2) perform the screenshot ; 3) and save the file to a destination.  I am open to any suggestions to make this work.    </p>
  
  <p>I appreciate any help I can get at this point.  Thank you.</p>