Copy bat file from another place

I have kept my project folder at Desktop. the path is at my system is "C:\Documents and Settings\ADMIN\Desktop\Code"

Now i want copy a BAT file from this folder and paste it at "C:\Project\Abhi".

To perform this task, i have made a application in which first it will make a batch file, whcich will print the project folder path and then it will execute it.

This task has been done, it print the code in batch file, but since the path is "C:\Documents and Settings\ADMIN\Desktop\Code", the batch file is not executing.

Suppose any where i am keep my project folder in my system, it will copy a batch file from there and paste it some other destination, which is not performing, because the folder path containg "C:\Documents and Settings\ADMIN\Desktop\Code".There is space between Documents and Settings.

When i changed docume~1, manually at command prompt, then it will work.

Please help me to solve this problem.

code:-

Dim Str As String
Str = App.Path

Print Str
[1048 byte] By [abhit_kumar] at [2007-11-20 10:52:27]
# 1 Re: Copy bat file from another place
If you are using long paths in your batch file, place quotations around the path/exe name.
Ex: Copy C:\Project\Abhi\my.bat "C:\Documents and Settings\ADMIN\Desktop\Code\my.bat"
Ex: Copy "C:\Project\Abhi\my.bat" "C:\Documents and Settings\ADMIN\Desktop\Code\my.bat"
LaVolpe at 2007-11-9 19:34:15 >
# 2 Re: Copy bat file from another place
Create a new bat file from VB code

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub cmdmak_Click()
On Error GoTo err:
Call ShellExecute(0, "Open", App.Path & "/Mycopy.bat", "", 0, 1)
MsgBox "Executed successfully.", vbInformation
Exit Sub
Resume
err:
MsgBox err.Description
End Sub

In this bat file use a Proper command to copy the files like.
Copy "C:\Project\Abhi\my.bat" "C:\Documents and Settings\ADMIN\Desktop\Code\my.bat"
shaluIT at 2007-11-9 19:35:21 >