Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 21st, 2012  |  syntax: None  |  size: 1.70 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. VB script error path Path not found(800A004C)
  2. Const OSCPATH = "FmwiretestOutput"
  3. Const ALL_USERS_APPLICATION_DATA = &H23&
  4.  
  5. Dim fso                 ' File System Object
  6. Dim objApplication      ' Application object
  7. Dim objFolder           ' Folder object
  8. Dim objFolderItem       ' FolderItem object
  9. Dim fname               ' Path to Settings folder
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.                 Set objApplication  = CreateObject("Shell.Application")
  17.                 Set objFolder = objApplication.Namespace(ALL_USERS_APPLICATION_DATA)
  18.                 Set objFolderItem = objFolder.Self
  19.                 fname = objFolderItem.Path & OSCPATH
  20.  
  21.                 Set fso = CreateObject("Scripting.FileSystemObject")
  22.                 If fso.FolderExists(fname) Then
  23.                 Set objFolder = fso.GetFolder(fname)
  24.                 Else
  25.                 Set objFolder = fso.CreateFolder(fname)
  26.                    If Err Then
  27.                      Err.Clear
  28.                       strErr = SPOFOLDERFAIL
  29.                       rCode = 4
  30.                    End If
  31.                 End If
  32.        
  33. Const OSCPATH = "FmwiretestOutput"
  34. Const ALL_USERS_APPLICATION_DATA = &H23&
  35.  
  36. Set objApplication  = CreateObject("Shell.Application")
  37. Set objFolder = objApplication.Namespace(ALL_USERS_APPLICATION_DATA)
  38. Set objFolderItem = objFolder.Self
  39. fname = objFolderItem.Path
  40.  
  41. Set fso = CreateObject("Scripting.FileSystemObject")
  42. folders = Split(OSCPATH, "")
  43. For i = 0 To UBound(folders)
  44.     fname = fso.BuildPath(fname, folders(i))
  45.     If fso.FolderExists(fname) Then
  46.         Set objFolder = fso.GetFolder(fname)
  47.     Else
  48.         Set objFolder = fso.CreateFolder(fname)
  49.        If Err Then
  50.          Err.Clear
  51.           strErr = SPOFOLDERFAIL
  52.           rCode = 4
  53.        End If
  54.     End If
  55. Next