+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
Scripts Thread, Stupid batch files... in Coding and Web Development; I would use UNC paths in that script rather than mapped drives. Much easier!...
  1. #16


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,747
    Thank Post
    221
    Thanked 2,626 Times in 1,936 Posts
    Rep Power
    778
    I would use UNC paths in that script rather than mapped drives. Much easier!

  2. #17
    AlexB's Avatar
    Join Date
    Jul 2006
    Location
    Warwickshire
    Posts
    365
    Thank Post
    36
    Thanked 36 Times in 32 Posts
    Rep Power
    23
    Quote Originally Posted by Arthur View Post
    I would use UNC paths in that script rather than mapped drives. Much easier!
    agreed

  3. #18
    themightymrp's Avatar
    Join Date
    Dec 2009
    Location
    Leeds, West Yorkshire
    Posts
    1,201
    Thank Post
    211
    Thanked 222 Times in 191 Posts
    Rep Power
    72
    Try renaming the file to .cmd instead of .bat

    Then also fill in the "Start in" box to be the path to the folder containing the script. I've had issues like this before and this solved it

  4. #19

    X-13's Avatar
    Join Date
    Jan 2011
    Location
    /dev/null
    Posts
    9,013
    Thank Post
    591
    Thanked 1,941 Times in 1,342 Posts
    Blog Entries
    19
    Rep Power
    812
    Quote Originally Posted by themightymrp View Post
    Try renaming the file to .cmd instead of .bat

    Then also fill in the "Start in" box to be the path to the folder containing the script. I've had issues like this before and this solved it
    I already changred the "Start in".

    I'll give .cmd a try.

    Quote Originally Posted by Arthur View Post
    I would use UNC paths in that script rather than mapped drives. Much easier!
    \\ip\share?

    I already did that...

    I may start again with a test version that just dumps everything into a log file so I can see what the butts is going on.

    If the scheduler actually saved credentials, I doubt I'd be having problems...

  5. #20
    AlexB's Avatar
    Join Date
    Jul 2006
    Location
    Warwickshire
    Posts
    365
    Thank Post
    36
    Thanked 36 Times in 32 Posts
    Rep Power
    23
    Quote Originally Posted by X-13 View Post
    If the scheduler actually saved credentials, I doubt I'd be having problems...
    I may have missed the OS you were using, but Windows Task Scheduler does store credentials....

  6. #21

    X-13's Avatar
    Join Date
    Jan 2011
    Location
    /dev/null
    Posts
    9,013
    Thank Post
    591
    Thanked 1,941 Times in 1,342 Posts
    Blog Entries
    19
    Rep Power
    812
    Quote Originally Posted by AlexB View Post
    I may have missed the OS you were using, but Windows Task Scheduler does store credentials....
    2008 R2.

    And it just fails to save them if I try... It's a known problem.

    The annoying thing is that it USED to have the details. It decided not to save any more when I wanted to remove my account from it and use the generic sysadmin one.

  7. #22

    Join Date
    Sep 2010
    Posts
    548
    Thank Post
    26
    Thanked 62 Times in 58 Posts
    Rep Power
    19
    I used 2008R2 to backup to a buffalo NAS using XCOPY and a scheduled task, i created a user for the job and added it to the RUN JOB AS in security options and it worked. i didnt realise there was an issue with adding a user to the RUN JOB AS function.

    if its just sitting there is it waiting for a prompt in the script perhaps
    Last edited by SHimmer45; 11th June 2014 at 12:55 PM.

  8. #23


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,572
    Thank Post
    228
    Thanked 851 Times in 730 Posts
    Rep Power
    294
    when running it manually might be worth removing the @echo off so youi can see what its doing but by the looks it dosent like your share location either dosent have access or cant find it

  9. #24
    superfletch's Avatar
    Join Date
    Nov 2007
    Location
    South
    Posts
    434
    Thank Post
    146
    Thanked 77 Times in 61 Posts
    Rep Power
    31
    Not sure if some of the echo strings might need to be in quotations?

    For instance:

    Code:
    net use Y: "\\[server]\[share]" && echo %TIME% - set first drive letter! >> log.txt || echo %TIME% - map first drive failed >> log.txt 
    Might be:

    Code:
    net use Y: "\\[server]\[share]" && echo "%TIME% - set first drive letter!" >> log.txt || echo "%TIME% - map first drive failed" >> log.txt 


    Maybe??

    Can you test that the system account is normally able to map that drive - ie) open a command window as the system account and test you can map the drive.

    ------

    Also has a user other than system already got this share mapped as a drive in a different session on this server? (eg you or the administrator account is logged in with a mapped drive using it)?
    Last edited by superfletch; 11th June 2014 at 01:20 PM.

  10. #25


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,747
    Thank Post
    221
    Thanked 2,626 Times in 1,936 Posts
    Rep Power
    778
    Quote Originally Posted by X-13 View Post
    I already did that...
    For both the source and destination locations? i.e.

    Code:
    @ECHO OFF
    SETLOCAL ENABLEDELAYEDEXPANSION
    SET SCRIPTDIR=%~dp0
    SET SCRIPTDIR=%SCRIPTDIR:~0,-1%
    
    robocopy "\\Server\RMStaff" "\\Server\Share1" /MIR /V /R:0 /W:0 /NP /LOG+:"%SCRIPTDIR%\RoboCopy.log"
    robocopy "\\Server\RMStaff" "\\Server\Share2" /MIR /V /R:0 /W:0 /NP /LOG+:"%SCRIPTDIR%\RoboCopy.log"

  11. #26

    X-13's Avatar
    Join Date
    Jan 2011
    Location
    /dev/null
    Posts
    9,013
    Thank Post
    591
    Thanked 1,941 Times in 1,342 Posts
    Blog Entries
    19
    Rep Power
    812
    Quote Originally Posted by Arthur View Post
    For both the source and destination locations?
    Yup. That's how it was originally.


    I just had a look on the NAS... The permissions got reset.

    Changed the SMB permissions back to RW and set the available folders to where it's backing up to... Possibly working now.

    My "output everything" version started logging all the filenames. Switched back to the silent version, kicked it off and we'll see how it goes.

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 8
    Last Post: 28th May 2012, 02:02 PM
  2. prezzie batch file to collect dps logs
    By russdev in forum ICT KS3 SATS Tests
    Replies: 4
    Last Post: 16th May 2006, 12:16 PM
  3. batch file help
    By beeswax in forum Scripts
    Replies: 9
    Last Post: 3rd March 2006, 07:48 PM
  4. numbers and batch files
    By russdev in forum Windows
    Replies: 4
    Last Post: 19th November 2005, 09:51 PM
  5. Blocking Batch Files using Group Policy in Server 2003
    By markwilliamson2001 in forum Windows
    Replies: 13
    Last Post: 4th October 2005, 05:28 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
  •