+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
Scripts Thread, What's wrong with this boot script? in Coding and Web Development; Hi, We are running through are numerous tidy up jobs after changing our whole domain and workstation setup. I am ...
  1. #1
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,550
    Thank Post
    518
    Thanked 56 Times in 50 Posts
    Rep Power
    30

    What's wrong with this boot script?

    Hi,
    We are running through are numerous tidy up jobs after changing our whole domain and workstation setup.
    I am having a real struggle trying to do the simplest of task, I think because there are so many of them!

    I am trying to create a boot script that will copy files from \\Dc1\netlogon\_INF\SMTRAN\_ALL to c:\windows\start

    this is to add any extra shortcuts to our users menu as an when they crop up.

    However when my script runs - COPY "\\DC1\NETLOGON\_INF\SMTRAN\_All" "C:\WINDOWS\START\"

    I get an error the system cannot find the file specified.

    Can someone tell me what I am doing wrong?

    Thanks

  2. #2
    Quackers's Avatar
    Join Date
    Jan 2006
    Posts
    1,450
    Thank Post
    45
    Thanked 160 Times in 135 Posts
    Rep Power
    57
    I could be wrong but i think batch files do not like to copy from UNC paths, when i used them in the XP days i mapped a network drive to the share first then did a net use * /delete at the end to disconnect the network drive.

  3. #3

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    10,051
    Thank Post
    3,583
    Thanked 1,123 Times in 1,025 Posts
    Rep Power
    377
    Quote Originally Posted by Quackers View Post
    I could be wrong but i think batch files do not like to copy from UNC paths, when i used them in the XP days i mapped a network drive to the share first then did a net use * /delete at the end to disconnect the network drive.
    Most likely the safest method but did find this using pushd and popd :

    Simplify UNC usage in command line batch files | Remote Administration For Windows

  4. #4
    Jamo's Avatar
    Join Date
    Jan 2009
    Posts
    1,365
    Thank Post
    66
    Thanked 178 Times in 150 Posts
    Rep Power
    61
    try xcopy or robocopy they both accept UNC.

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,373
    Thank Post
    906
    Thanked 1,811 Times in 1,559 Posts
    Blog Entries
    12
    Rep Power
    468
    What OS are you on?

  6. #6
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,550
    Thank Post
    518
    Thanked 56 Times in 50 Posts
    Rep Power
    30
    I'm using Windows 7 with server 2008 R2. Thanks
    for all the replies so far!

  7. #7

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,373
    Thank Post
    906
    Thanked 1,811 Times in 1,559 Posts
    Blog Entries
    12
    Rep Power
    468
    try this

    robocopy "\\DC1\NETLOGON\_INF\SMTRAN\_All" "C:\WINDOWS\START" /mir

  8. Thanks to FN-GM from:

    reggiep (6th September 2012)

  9. #8
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,550
    Thank Post
    518
    Thanked 56 Times in 50 Posts
    Rep Power
    30
    As always FN, I bow down to your amazingness!

    That worked!

  10. #9
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,550
    Thank Post
    518
    Thanked 56 Times in 50 Posts
    Rep Power
    30
    Although I may have to take back some of the praise as that currently takes anything that is in the folder and removes it! I assume the /MIR switch at the end is to blame!

  11. #10

    Join Date
    Oct 2008
    Location
    West Midlands
    Posts
    16
    Thank Post
    4
    Thanked 4 Times in 2 Posts
    Rep Power
    13
    would a vbs script do the job, something like;

    Set fso = CreateObject("Scripting.FileSystemObject")
    fso.CopyFile "\\UNC_Path\File", "Dest_File",TRUE

  12. #11

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    10,051
    Thank Post
    3,583
    Thanked 1,123 Times in 1,025 Posts
    Rep Power
    377
    Quote Originally Posted by kism3t View Post
    would a vbs script do the job, something like;

    Set fso = CreateObject("Scripting.FileSystemObject")
    fso.CopyFile "\\UNC_Path\File", "Dest_File",TRUE
    Would WMI work --> one of the copy methods as per this link :

    Scripting Files and Folders using VBScript

    http://www.tek-tips.com/viewthread.cfm?qid=1143068
    Last edited by mac_shinobi; 6th September 2012 at 05:29 PM.

  13. #12
    soveryapt's Avatar
    Join Date
    Jan 2009
    Location
    Lancashire
    Posts
    2,436
    Thank Post
    672
    Thanked 279 Times in 246 Posts
    Rep Power
    78
    Shortcuts, as in desktop short cuts to programs and network locations etc?

    If you're using 2008 R2 and W7, why not look at the User Windows Preferences and set the short cuts from within GPO .. works here for me and you can target them to different users if you need to.

  14. #13

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,373
    Thank Post
    906
    Thanked 1,811 Times in 1,559 Posts
    Blog Entries
    12
    Rep Power
    468
    Quote Originally Posted by reggiep View Post
    Although I may have to take back some of the praise as that currently takes anything that is in the folder and removes it! I assume the /MIR switch at the end is to blame!
    do you mean in the destination folder? /mir will make it a exact replica of the source. You can change it if you want a merge. If you want to merge use this code

    robocopy "\\DC1\NETLOGON\_INF\SMTRAN\_All" "C:\WINDOWS\START" /copy:d

    Personally i wouldnt over complicate it with a VBS script.
    Last edited by FN-GM; 6th September 2012 at 06:01 PM.

  15. #14
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,550
    Thank Post
    518
    Thanked 56 Times in 50 Posts
    Rep Power
    30
    I'll stick to robocopy thanks. Did the job with a /S switch.

  16. #15
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,550
    Thank Post
    518
    Thanked 56 Times in 50 Posts
    Rep Power
    30
    Can I just thank all the guys who replied to this thread. Having a bad time at the moment here as there are loads of little niggles with our new system that are keeping us very busy. It's great to know that people out there are willing to help us without expecting anything in return!

  17. Thanks to reggiep from:

    mac_shinobi (7th September 2012)



SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 5th October 2011, 02:30 PM
  2. Can't see what is wrong with this
    By AyatollahPies in forum Scripts
    Replies: 6
    Last Post: 21st July 2010, 02:18 PM
  3. [MS Office - 2010] What's wrong with this picture?
    By AngryTechnician in forum Office Software
    Replies: 7
    Last Post: 5th May 2010, 09:54 AM
  4. What's Wrong With This Printer?
    By enjay in forum Hardware
    Replies: 14
    Last Post: 12th February 2010, 10:41 AM
  5. whats wrong with this script :(
    By PEO in forum Scripts
    Replies: 7
    Last Post: 16th June 2009, 01:40 PM

Thread Information

Users Browsing this Thread

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

Posting Permissions

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