file copy help that has path not found error

Author Message
as14921115

  • Total Posts : 3
  • Scores: 0
  • Reward points : 0
  • Joined: 1/24/2012
  • Status: offline
file copy help that has path not found error Thursday, January 26, 2012 11:11 AM (permalink)
0
I have all the necessary variables declared that are used in this script. I get path not found error on the line:
oFSO.CopyFile ("*.*"), (DestProgWin7), True
I have tried without parenthesis to no avail for source and path. The script is placed in the path that contains all the files to be copied over. Any help please?

dim oFSO,oShell
dim DestProgXP,DestProgWin7
dim DestStartXP,DestStartWin7
set oFSO = CreateObject ("Scripting.FileSystemObject")
set oShell = CreateObject ("Wscript.Shell")
DestProgXP = ("C:\Program Files\WinZip\")
DestProgWin7 = ("C:\Program Files (x86)\WinZip\")
DestStartXP = ("C:\Documents and Settings\All Users\Start Menu\Programs\WinZip\")
DestStartWin7 = ("C:\Users\All Users\Microsoft\Windows\Start Menu\Programs\WinZip\")
if oFSO.FolderExists("C:\Documents and Settings") Then
oFSO.CopyFile ("*.*"), (DestProgXP), True
oFSO.CopyFile ("*.CHM"), (DestStartXP), True
Else if oFSO.FolderExists("C:\Users") Then
oFSO.CopyFile ("*.*"), (DestProgWin7), True
oFSO.CopyFile ("*.CHM"), (DestStartWin7), True
Else
MsgBox ("This program is only intended for Windows XP x32 or Windows 7 x64.")
End if
End if
 
#1
    dm_4ever

    • Total Posts : 3687
    • Scores: 82
    • Reward points : 0
    • Joined: 6/29/2006
    • Location: Orange County, California
    • Status: offline
    Re:file copy help that has path not found error Thursday, January 26, 2012 11:18 AM (permalink)
    0
    did you try
     
    if oFSO.FolderExists("C:\Documents and Settings") Then
    oFSO.CopyFile ("C:\Documents and Settings\*.*"), (DestProgXP), True
    oFSO.CopyFile ("C:\Documents and Settings\*.CHM"), (DestStartXP), True
    Else if oFSO.FolderExists("C:\Users") Then
    oFSO.CopyFile ("C:\Users\*.*"), (DestProgWin7), True
    oFSO.CopyFile ("C:\Users\*.CHM"), (DestStartWin7), True
    Else
    dm_4ever

    My philosophy: K.I.S.S - Keep It Simple Stupid
    Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
    Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2
      as14921115

      • Total Posts : 3
      • Scores: 0
      • Reward points : 0
      • Joined: 1/24/2012
      • Status: offline
      Re:file copy help that has path not found error Thursday, January 26, 2012 3:01 PM (permalink)
      0
      So you are saying that instead of assuming the default path where the .vbs resides and copying all files from there, provide the entire path of files to be copied from?
      What I am trying is this: if c:\documents and settings folder exists, then copy all files from current path to c:\documents and settings\all users\start menu\programs\WinZip, otherwise copy all files from current path to C:\Users\all users\start menu\programs\WinZip. The modification you have provided is copying stuff from the conditional path. Thanks for your great help. ciao.
       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9