Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369

    Unanswered: A weird problem with DOS syntax error

    I have some back up systems with .bat files that rename the file to include date/time. I have no problem, others who have usd it have no problem, until recently a friend wanted to use it. It works (exceprt for him) om computers from 2003 through to Dells with Vista only purchased last week.

    A couple of versions that are causing an "incorrect syntax" message.

    set Day=%Date:~4,2%
    set Mth=%Date:~7,2%
    set Yr=%Date:~10,4%
    set Hr=%Time:~0,2%
    set Min=%Time:~3,2%
    set Sec=%Time:~6,2%

    ren *.mdb Viper%Hr%%Min%%Sec%-%Day%%Mth%%Yr%.mdb

    This is a simple one for just copying from one directory to another directory (sorrry, folder )

    copy c:\ViperTransfer\Viper.mdb c:\Viperdaily\Viper_%date:~4,2%_%date:~7,2%_%date: ~10,4%_%Time:~1,1%_%Time:~3,2%_%Time:~6,2%.mdb


    Two of the computers he has a identical to mine.....bought together etc.

    I have a few versions and his case either nothing copies across or just Viper.mdb goes across.

    Any ideas.

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    ^^ and this is an Access problem because..........

    Been a loooong time since I've dealt with batch files!

    What I would do is use a VBS script instead of batch files.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    Well I do have one that opens a little db in the middle of the .bat file for doing the renaming with date/time.

    And don't knock .bat files thye are good.

    My friends concern is if there is some problem with his computer set up and the incorrect syntax msg is a symptom.

    As to ne an Access topic.....well I would have thought various methods of backing up an .mdb were Access related. On eodf the reasons for renaming the file with date/time is that you are not continually replacing a file with one that could be corrupt.

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I don't remember "knocking" batch files... I still use them on occasion too, but only simple ones these days ^^

    One possibility... is there a kind of "regional setting" in DOS? I think there is somewhere, but it's been sooooo long! CONFIG.SYS comes to mind... TBH, I would also be concerned if my new computer wouldn't run a batch file that another machine does... I'd be quite annoyed really!

    I agree with your philosophy of backing up the way you are... I have done it the same in the past, but I can't for the life of me remember how I did it.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    There is something common to his 4 computers.

    Although I am not 100% but I think the new Dell Vista might be ok with.

    JUst as an experiment I have sent him a .bat file that just sets the times

    Just this part.

    set Day=%Date:~4,2%
    set Mth=%Date:~7,2%
    set Yr=%Date:~10,4%
    set Hr=%Time:~0,2% and 1 and 1% for the 10am change over
    set Min=%Time:~3,2%
    set Sec=%Time:~6,2%

    He is in bed so I will hear back tomorrrow.

    I think the problem is coming form this section

    ren *.mdb Viper%Hr%%Min%%Sec%-%Day%%Mth%%Yr%.mdb

    So it might be in the Ren DOS command.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    could be a memory issue
    dont laugh but you can get into all sorts of problems in the DOS batch world if you are short on system resources.. check the path see if its excessively long
    it could be a failing network logon script which leaves the system in limbo
    it could be an internationalisation issue
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    He is i Australialia like me...so that is a start.

    He disconnected oe machie from interneter and network. However, in my exerience unplugging the machie from the router does not result in the same as a machine that has never been on the router......perhpaps this could be a problem.

    I know the .bat file works in America because some are using with just a change in computer/directory names. I have made so it backs up two externarl hard drives and four computers amd can be run from any of the computers. In other words Computer C has a FE Access but when run from that computer it is copying the FE from Computer A all over the place.

    But you might be onto something with the network. Apart from the Dell/Vista the others were set up by another person and with the Dell I just added that over the phone with him.

    I also have a problem with Vista and Code/Word/Bookmarks and word opening in minimised. I have tried on access programmers UK but can get nowhere, so will try here. And DoCmd.maximize don't help.

  8. #8
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    I don't like cross posting so will bury in this thread. Maybe somone can help

    http://www.access-programmers.co.uk/...d.php?t=152054

Posting Permissions

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