Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Shell.Run "cd """ & MyDocumentsPath & """", 1, True
  2. Shell.Run "cd " & Chr(34) & MyDocumentsPath & "Chr(34)", 1, True
  3.  
  4. Shell.Run "cd ""C:UsersGardD""", 1, True
  5.  
  6. Dim Shell As Object ' An instance of the 'Shell' object
  7. Set Shell = VBA.CreateObject("WScript.Shell")
  8.  
  9. Dim MyDocumentsPath As String ' The path to the current users 'My Documents' folder
  10. MyDocumentsPath = GetMyDocumentsPath
  11.  
  12. Shell.Run "cd " & MyDocumentsPath, 1, True ' Change the Shell start location to the users 'My Documents' folder
  13. Shell.Run DIR_CMD & DIR_FILE_PATH, 1, True ' Output the full file paths of all files in the users 'My Documents' folder
  14.  
  15. Set Shell = Nothing ' Destroy the 'Shell' object
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement