title: Specify the windows folder path in VBScript
body: <p>I have a vbscript ,which sends the folder contents as attachments to my email but the problem is i am unable to specify the path of windows folder because the windows path is different for different computers.</p>
  
  <p>In my code following works</p>
  
  <p><code>Const PATH = "C:\windows\Folder1\"</code> </p>
  
  <p>but since path is different for different machines. i tried following but no success</p>
  
  <p><code>Const PATH = "%windows%\Folder1\"</code></p>
  
  <p>Here is the full vbscript code</p>
  
  <pre><code>Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
  Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
  
  Const cdoAnonymous = 0 'Do not authenticate
  Const cdoBasic = 1 'basic (clear-text) authentication
  Const cdoNTLM = 2 'NTLM
  
  
  Set objMessage = CreateObject("CDO.Message")
  Set fso = CreateObject("Scripting.FileSystemObject")
  Dim oFolder
  Dim oFile
  Dim oFiles
  Const PATH = "%windows%\Folder\" 'This method not working!!!!! 
  Set oFolder = fso.GetFolder(PATH)
  Set oFiles= oFolder.files
  objMessage.Subject = "This is the email subject"
  objMessage.From = "mailSender@MyMail.com"
  objMessage.To = ""
  objMessage.TextBody = "This is the body of the email. I’m fairly unoriginal"
  For Each oFile in oFolder.files
  objMessage.AddAttachment PATH &amp; oFile.name
  Next
  '==This section will provide the configuration information for the remote SMTP server.
  '==End remote SMTP server configuration section==
  
  objMessage.Send
  </code></pre>
  
  <p>when the  configuration information for the remote SMTP server the code works perfectly.</p>
  
  <p>how will i specify the windows,programfiles,desktop(special folders) in this script??</p>