Bat Files

R

RBDU

Hi All! thanking anyone for a reply.

A few questions re Bat files in Windows XP

1. I have a bat file called - Search.BAT. It copies a access 2003 database,
on the close of that database to a Pen drive "F drive". Works OK but at
times it causes the computer to freeze when the Bat file message to shown to
the user. Any ideas here?

2. It appears that when I wrote the bat file, it does not like long entries
such as -D:\offline\macca\desktop\search.mdb.
I changed the attributes to a shorter string and now it works. Is that the
case re long attributes?

3. One of the access databases called, "Land Search.mdb" had a problem with
the two names within the bat file. The bat file could not find it. When I
changed it to "LandSearch.mdb", the bat file worked. Any comments here?

Regards Peter
 
G

Guest

Yeh, use underlines to take the place of spaces. And yes, breaking up your
commands to individual lines is helpful. Do you run the bat from the run
line or shortcut?
 
G

Guest

3. One of the access databases called, "Land Search.mdb" had a problem with
the two names within the bat file. The bat file could not find it. When I
changed it to "LandSearch.mdb", the bat file worked. Any comments here?

when the path or file name contains spaces it always needs to go in double
quotes.
"c:\folder name\file name.xxx"
i make it habit to always put path or file names in "" even if it does not
contain spaces.

can you post your code to help with questions 1 and 2?
 
V

Vanguard

RBDU said:
Hi All! thanking anyone for a reply.

A few questions re Bat files in Windows XP

1. I have a bat file called - Search.BAT. It copies a access 2003
database, on the close of that database to a Pen drive "F drive".
Works OK but at times it causes the computer to freeze when the Bat
file message to shown to the user. Any ideas here?

Depends on what your batch script is doing and how you run the .bat
file. Show the contents of the .bat file if you want us to analyze it.
2. It appears that when I wrote the bat file, it does not like long
entries such as -D:\offline\macca\desktop\search.mdb.
I changed the attributes to a shorter string and now it works. Is that
the case re long attributes?

Batch files work just find with long paths and filenames. You could use
their 8.3 short forms rather than their long names.
3. One of the access databases called, "Land Search.mdb" had a problem
with the two names within the bat file. The bat file could not find
it. When I changed it to "LandSearch.mdb", the bat file worked. Any
comments here?

Because you did not enclose the path and/or filename within quotes, as
in "Land Search.mdb". Without quoting the string (to denote it is one
string), parsing would see two parameters: "Land" and "Search.mdb".
 
P

P.McCartney

Thanking You
Regards Peter

Vanguard said:
Depends on what your batch script is doing and how you run the .bat file.
Show the contents of the .bat file if you want us to analyze it.


Batch files work just find with long paths and filenames. You could use
their 8.3 short forms rather than their long names.


Because you did not enclose the path and/or filename within quotes, as in
"Land Search.mdb". Without quoting the string (to denote it is one
string), parsing would see two parameters: "Land" and "Search.mdb".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Bat files 2
using ansi.sys in a *.bat file 1
Batch files 2
Access Denied when using a .bat file 2
date format and BAT execution 1
BAT File to Run 3 Programs 4
Help with .bat 4
Creating a .bat file? 43

Top