Results 1 to 4 of 4

Thread: Can anyone help with this tiny bit of VB script?

  1. #1
    Jay
    Jay is offline
    Gentlemen.. we're history Jay's Avatar
    Join Date
    Aug 2006
    Location
    Jita
    Posts
    8,365
    Thanks
    304
    Thanked
    568 times in 409 posts

    Can anyone help with this tiny bit of VB script?

    Code:
    Dim FSO
    
    Set FSO = CreateObject("Scripting.FileSystemObject")
    
    FSO.CopyFile "\\server\share\file.exe", "%Homedrive%\%Homepath%\desktop\"
    The issues are with the %homedrive%\%homepath%\desktop the script says it can't find the path

    This script just copies a file from the network to the users desktop
    Last edited by Jay; 04-06-2009 at 11:20 AM.
    □ΞVΞ□

  2. #2
    I R Toff Pandi! TAKTAK's Avatar
    Join Date
    Mar 2008
    Location
    Vergon6
    Posts
    7,449
    Thanks
    549
    Thanked
    1,012 times in 747 posts
    • TAKTAK's system
      • Motherboard:
      • ASUS ROG STRIX B450-F GAMING
      • CPU:
      • Ryzen 7 3700X
      • Memory:
      • 16GB Corsair Vengeance LPX 3200MHz
      • Storage:
      • 500GB Samsung 970 EVO
      • Graphics card(s):
      • 5700 XT 50th Anniversary
      • PSU:
      • Be Quiet SFX-L 600W
      • Case:
      • Lian Li PC-O11 Mini
      • Operating System:
      • Windows 10
      • Monitor(s):
      • LG Ultrawide
      • Internet:
      • 200Mb FTTP

    Re: Can anyone help with this tiny bit of VB script?

    "%Homedrive%\%Homepath%\desktop\"

    Does it need the %Homedrive%?
    Would that not be covered with %Homepath%?

    (im not very good with vB )
    Post Counts and Other Rewards, Rules, Folding@Home, Fans: Push vs Pull vs Push-Pull, Corsair PSU OEMs.

    Quote Originally Posted by razer121 View Post
    Would you like me to enter you? it would be my pleasure
    TAKTAK.co.uk

  3. #3
    Jay
    Jay is offline
    Gentlemen.. we're history Jay's Avatar
    Join Date
    Aug 2006
    Location
    Jita
    Posts
    8,365
    Thanks
    304
    Thanked
    568 times in 409 posts

    Re: Can anyone help with this tiny bit of VB script?

    that is a very good point but it will not put the drive letter in for commands so its needed

    Last edited by Jay; 04-06-2009 at 12:23 PM.
    □ΞVΞ□

  4. #4
    Jay
    Jay is offline
    Gentlemen.. we're history Jay's Avatar
    Join Date
    Aug 2006
    Location
    Jita
    Posts
    8,365
    Thanks
    304
    Thanked
    568 times in 409 posts

    Re: Can anyone help with this tiny bit of VB script?

    fixed it... well I started again.

    here it is...

    Code:
    Set WshShell = WScript.CreateObject("WScript.Shell")
    Set WshMyEnv = WshShell.Environment("PROCESS")
    userprof = WshMyEnv("userprofile")
    
    strDirectory=userprof & "\desktop\"
    strFile = strDirectory & "installer.exe"
    ' Create the File System Object
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    If Not objFSO.FileExists(strFile) Then
        sourcelocation = "\\server\share\update\installer.exe"
        targetlocation = strDirectory
           objFSO.CopyFile sourcelocation, targetlocation, true
    End If
    WScript.Quit
    Last edited by Jay; 04-06-2009 at 12:01 PM.
    □ΞVΞ□

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Vista 64 Bit downside??
    By catcando in forum Software
    Replies: 11
    Last Post: 02-09-2008, 02:28 AM
  2. vista 64 bit MSDN?
    By TAKTAK in forum Software
    Replies: 6
    Last Post: 21-08-2008, 11:09 PM
  3. Replies: 3
    Last Post: 11-06-2008, 04:41 PM
  4. is it worth having 4GB (3.25GB) on Vista 32 bit?
    By mosherben in forum Help! Quick Relief From Tech Headaches
    Replies: 6
    Last Post: 06-01-2008, 02:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •