Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Batch File Creation

Reply
Thread Tools Display Modes

Batch File Creation

 
 
Andrew
Guest
Posts: n/a

 
      05-11-2011
Hi,

We have a requirement from our SAP Team to create a batch file which
will copy the SAP contents on users profile by creating a folder SAP

For XP: C:\documents and settings\%username%\Application Data\SAP
For Windows 7: C:\users\%username%\appdata\roaming\Sap.

I created a below batch file but unable to copy the contents on excat
location.

copy Test.xml C:\"documents and settings"\"%username%"\appdata\roaming
\sap
copy text.xml C:\users\"%username%"\"application data"\sap

Can you please assist me creating a batch file.

Thanks
Andrew
 
Reply With Quote
 
 
 
 
John John - MVP
Guest
Posts: n/a

 
      05-12-2011
On 5/11/2011 7:21 AM, Andrew wrote:
> Hi,
>
> We have a requirement from our SAP Team to create a batch file which
> will copy the SAP contents on users profile by creating a folder SAP
>
> For XP: C:\documents and settings\%username%\Application Data\SAP
> For Windows 7: C:\users\%username%\appdata\roaming\Sap.
>
> I created a below batch file but unable to copy the contents on excat
> location.
>
> copy Test.xml C:\"documents and settings"\"%username%"\appdata\roaming
> \sap
> copy text.xml C:\users\"%username%"\"application data"\sap
>
> Can you please assist me creating a batch file.
>
> Thanks
> Andrew


Do the destination folders exist? The Copy command will not create
folders, you have to use the MD command to create the folders, then the
copy command will be able to copy the file. Better yet would be to use
a command or tool that can create folders, like Xcopy or Robocopy.
Also, unless the command is launched in the source directory you need to
supply the fully qualified path of the source file, where is this
Test.xml file located? How would the Copy command (or Xcopy or
Robocopy) know that?

John
 
Reply With Quote
 
Andrew
Guest
Posts: n/a

 
      05-24-2011
On May 12, 3:26*pm, John John - MVP <audetw...@nbnot.nb.ca> wrote:
> On 5/11/2011 7:21 AM, Andrew wrote:
>
>
>
>
>
> > Hi,

>
> > We have a requirement from our SAP Team to create a batch file which
> > will copy the SAP contents on users profile by creating a folder SAP

>
> > For XP: C:\documents and settings\%username%\Application Data\SAP
> > For Windows 7: C:\users\%username%\appdata\roaming\Sap.

>
> > I created a below batch file but unable to copy the contents on excat
> > location.

>
> > copy Test.xml C:\"documents and settings"\"%username%"\appdata\roaming
> > \sap
> > copy text.xml C:\users\"%username%"\"application data"\sap

>
> > Can you please assist me creating a batch file.

>
> > Thanks
> > Andrew

>
> Do the destination folders exist? *The Copy command will not create
> folders, you have to use the MD command to create the folders, then the
> copy command will be able to copy the file. *Better yet would be to use
> a command or tool that can create folders, like Xcopy or Robocopy.
> Also, unless the command is launched in the source directory you need to
> supply the fully qualified path of the source file, where is this
> Test.xml file located? *How would the Copy command (or Xcopy or
> Robocopy) know that?
>
> John- Hide quoted text -
>
> - Show quoted text -


Thanks John,

We will be deploying the batch file Via SCCM, so the source file will
be in cache folder on every folder.
Ya i am able to create a folder using xcopy.

 
Reply With Quote
 
Special Access
Guest
Posts: n/a

 
      05-25-2011
On Mon, 23 May 2011 23:44:12 -0700 (PDT), Andrew
<> wrote:

>On May 12, 3:26*pm, John John - MVP <audetw...@nbnot.nb.ca> wrote:
>> On 5/11/2011 7:21 AM, Andrew wrote:
>>
>>

<SNIP>

Try putting quotes around the entire line:
copy Test.xml "C:\documents and
settings\%username%\appdata\roaming\sap"
and
copy text.xml "C:\users\%username%\application data\sap"

or specify a destination file name in addition to the location

The recommendation of xcopy or robocopy is a good one, as both are
much better than just 'copy'... xcopy syntax is similar to copy, but
Robocopy's syntax is quite different.

Mike
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot update/install Windows Installer 3.1 Redistributable (v2). BlueIce Windows Update 15 09-09-2010 06:15 AM
Cool Video Editor ddn85602 Windows Vista Music, Pictures and Video 0 06-12-2010 09:02 AM
Copying Shared folders and retaining share and file permissions Bry M Server Networking 7 03-24-2010 01:12 PM
error code 0x8024D007 jenny Windows Update 10 11-23-2009 05:48 PM
Re: Batch File program to search all physical drives and delete .jpg , .jpeg files Pegasus [MVP] Scripting 1 11-12-2009 03:50 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59