System.callSystem with xcopy

Hey guys,
I'm trying to copy a directory from one location to another using system.callSystem with the command xcopy. I've tested the string that I'm using as the parameter directly in the command prompt and it works, so I know that I'm feeding the function correctly. However, when I run it, nothing happens. Any ideas what could be going wrong? Is there something I'm missing?
here's the call:
system.callSystem('xcopy "' + sourceDir + '\\*.*" /e "' + targetDir + '"');
that string I'm feeding it is the equivalent of
xcopy "\\SOURCE_NETWORK\SOURCE_DIRECTORY\*.*" /e "\\TARGET_NETWORK\TARGET_DIRECTORY"

I test you code in AE CC 2014 ,and failed too. Maybe scripts do not have Direct permission to xcopy.Try the following method.
callStr = 'xcopy "' + sourceDir + '\\*.*" /e "' + targetDir + '"';
system.callSystem("cmd.exe /c \""+callStr+"\"");
It works fine now.So system.callSystem() does not equal to cmd.exe actually.  You should call the cmd.exe in this method.
However, at least  we can directly use "explorer" to approach the same goal.Just save the command string as a *cmd file.After running the temp file by call "explorer",remove it.
Here is the code:
callStr = 'xcopy "' + sourceDir + '\\*.*" /e "' + targetDir + '"';
outFile = File("~/Desktop/tempCmd.cmd");
outFile.open("w");
outFile.write(callStr);
outFile.close();
system.callSystem("explorer " + outFile.fsName.toString());
outFile.remove();
The difference of the two methods exists.The first method does show the String you called in cmd interface,while the second method not.
By the way,it seems that Relative Path does not work with xcopy,so make sure you convert the souceDir and targetDir to Absolute Path.

Similar Messages

  • Bulk upload bug in ODAC 11.2 Release 5 (11.2.0.3.20) with Xcopy Deployment

    There is a bug in ODP.NET (ODAC 11.2 Release 5 (11.2.0.3.20) with Xcopy Deployment)
    When large amount of data is uploaded using OracleBulkCopy the following exception is thrown
    System.EntryPointNotFoundException: Unable to find an entry point named 'OpsBulkCopyFreeDataPointers' in DLL 'OraOps11w.dll'.
    at Oracle.DataAccess.Client.OpsBC.FreeDataPointers(OPOBulkCopyValCtx* pOPOBulkCopyValCtx)
    at Oracle.DataAccess.Client.OracleBulkCopy.PerformBulkCopy()
    at Oracle.DataAccess.Client.OracleBulkCopy.WriteDataSourceToServer()
    at Oracle.DataAccess.Client.OracleBulkCopy.WriteToServer(DataTable table, DataRowState rowState)
    at Oracle.DataAccess.Client.OracleBulkCopy.WriteToServer(DataTable table)
    at OracleBulkUploadBug.Program.UploadData(OracleConnection connection)
    at OracleBulkUploadBug.Program.Main(String[] args)
    Steps to reproduce.+
    *1) Create a temp table*
    CREATE TABLE "RAM"."BLKUPLOADBUG"
    "COLUMN1" VARCHAR2(1000 BYTE),
    "COLUMN2" VARCHAR2(1000 BYTE),
    "COLUMN3" VARCHAR2(1000 BYTE),
    "COLUMN4" VARCHAR2(1000 BYTE),
    "COLUMN5" VARCHAR2(1000 BYTE)
    SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
    TABLESPACE "USERS" ;
    *2) Run the following c# code*
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Oracle.DataAccess.Client;
    using System.Data;
    namespace OracleBulkUploadBug
    class Program
    private const string TABLE_NAME = "BlkUploadBug";
    private const int ROWS_TO_INSERT = 10000;
    static void Main(string[] args)
    string ConnString = @"Data source=localhost/xexdb;User ID=ram; password=ram";
    try
    using (OracleConnection connection = new OracleConnection(ConnString))
    connection.Open();
    using (OracleCommand cmd = connection.CreateCommand())
    cmd.CommandText = string.Format("TRUNCATE TABLE {0}", TABLE_NAME);
    cmd.ExecuteNonQuery();
    Console.Write("Uploading data...");
    UploadData(connection);
    Console.WriteLine("done.");
    //ShowData(connection);
    catch (Exception ex)
    Console.WriteLine(ex);
    static void UploadData(OracleConnection connection)
    DataTable table = new DataTable(TABLE_NAME);
    table.Columns.Add("Column1", typeof(string));
    table.Columns.Add("Column2", typeof(string));
    table.Columns.Add("Column3", typeof(string));
    table.Columns.Add("Column4", typeof(string));
    table.Columns.Add("Column5", typeof(string));
    for (int i = 0; i < ROWS_TO_INSERT; i++)
    table.Rows.Add("aaa", "bbb", "ccc", "ddd", "eee");
    using (OracleBulkCopy oracleBulkCopy = new OracleBulkCopy(connection))
    oracleBulkCopy.DestinationTableName = table.TableName;
    oracleBulkCopy.WriteToServer(table);
    static void ShowData(OracleConnection connection)
    using (OracleCommand cmd = connection.CreateCommand())
    cmd.CommandText = string.Format("SELECT * FROM {0}", TABLE_NAME);
    using (OracleDataReader reader = cmd.ExecuteReader())
    while (reader.Read())
    Console.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}",
    reader.GetString(0), reader.GetString(1), reader.GetString(2),
    reader.GetString(3), reader.GetString(4));
    }

    Hi Greg,
    Thanks for the detailed explanation. Let me start off by describing our current scenario.
    We deploy our application with its own set of Oracle driver files (ODP.NET). The driver files were picked from Xcopy deployment package ODAC 11.2 Release 4 (11.2.0.3.0). This works fine for users (50% of our 1000+ user base) who do not have any other installation of Oracle drivers. For the rest of the users who may have another version of ODP.NET (ODAC 11.2 Release 5 (11.2.0.3.20)), installed via Oracle Universal Installer (OUI) we have a problem.
    Since Oracle.DataAccess.dll and OraOps11w.dll files have the same version numbers in different packages it is making things very difficult for us. The application picks up Oracle.DataAccess.dll version 11.2.0.3.20 as it is present in the GAC and uses the local OraOps11w.dll 11.2.0.3.0 present in the application folder. This causes the missmatch and the exception gets thrown. Please do note that the exception pops up only when uploading large amounts of data using Oracle bulk upload.
    You can use my demo code and try it out for yourself. Install 11.2.0.3.20 using OUI and copy OraOps11w.dll from 11.2.0.3.0 to the local application folder, next to the EXE file. The exception is reproducible always when ROWS_TO_INSERT >= 10000. Reduce the ROWS_TO_INSERT to < 1000 or 100 and it will work flawlessly. I think the error message Unable to find an entry point named 'OpsBulkCopyFreeDataPointers' in DLL 'OraOps11w.dll' is incorrect.
    It is true that there are multiple versions of OraOps11w of differing patch levels that all show the same version number.+ Any particular reason to do this? How do you keep track of which fixes are present in which file if the version number never changes?
    Regards,
    Ram

  • Hi, I was trying to copy and paste a lot of  info for one day on my calendar to another day and an error message popped up saying that the system responded with an error. Msg won't go away I force quit ical

    Need help for trying to unfreeze a message on my ical.  I was trying to copy and paste some appointment info from one day to another on my ical and a message popped up saying the system responded with an error.  All of my info was below the message.  I can't get that message to go away or work on the ical now at all.  I try to force quit ical and have shut down the computer and it still comes up.  Any suggestions?

    K,
    Try removing the com.apple.iCal.plist file from your Macintosh HD/Users/yourusername/Library/Preferences Folder. To find that Library folder, if you are using Lion, use Finder>Go Menu>Depress the "Option" key>Library. Drag the .plist file to your desktop, and log out/in or restart.
    Next, make sure that you are not connected to the internet. Then to to your Macintosh HD/Users/yourusername/Library/Calendars Folder and remove any files with "Cache" as a part of the file name. Use the same method as listed above to get to the correct Library Folder. Log out/in, or restart and check iCal for functionality.

  • I am about to buy a new computer and I noticed that the system comes with Windows8. I have Photoshop CS6 for windows 7. My question is can this be loaded onto the new windows 8 and if so what steps do i have to take?. Are there any things to avoid?

    I am about to buy a new computer and have noticed that the system comes with Windows 8. I have Photoshop CS6 for windows 7.
    I would like to know if this can be loaded on the new system? and what steps I need to take to ensure it functions correctly.

    Windows 8 meets Photoshop CS6 system requirements, see the link below
    System requirements | Photoshop

  • How do I place my files on a separate hard drive from the system drive with OS X?

    I have a mac pro and want to place my files on a seperate hard drive to the system. Can anybody please ad vise me what I have to do to achieve this. My OS X is Lion 10.7.5

    Drag and drop will normally work if the separate hard drive is formatted right:
    https://discussions.apple.com/docs/DOC-3003
    Mind you, an external hard drive is the ideal way of backing up data.   Software such as Carbon Copy Cloner or Time Machine can be used for backing up, and is much faster than using the Finder for drag and drop, and will ensure the entire system gets backed up.  
    Time Machine offers whole unbootable system backup with archiving.  Each archive has a temporary existence as long as the backups are automatic.  When you make them manual, you can copy them off to a non-time machine source to ensure they exist longer.  The larger your destination drive, the longer the archives last.
    Carbon Copy Cloner is used most often for clones, and it maintains an exact replica of the original, deleting anything the original had deleted on the copy that it makes, and its backups are bootable when they are successful.  It offers archiving options, but they aren't as transparent as Time Machine.
    Firewire 800 is faster than USB 2.   PCI eSATA and Thunderbolt cards are faster.  The ability to boot the PCI based cards varies by card.  But the SATA drives can be inserted internally if you want them to be boot.  Some SATA drives need a jumper to be able to be read by your 1.1's slower internal SATA bus speed.  Check with the hard drive vendor.  USB 3 cards exist as well, though I've heard USB 3 has difficulty with WiFi interferance.

  • XI Integration Engine- You cannot log on to system BS_SAP_R_3 with user XIR

    I have given the correct user name and password while creating RFC destination and Port.
    And I see wrong user ID/password in ping status.
    Ping Status: You cannot log on to system BS_SAP_R_3 with user XIRWBUSER
    Last Retry Thu Jan 18 23:13:47 UTC 2007 .
    Can anybody guide me on this?
    Thanks
    Chiru

    Hi,
    I have correct user id/ password in RFC destination. I do not know why in Runtime work Bench it is showing the wrong userid/password.
    I forgot to give it at the first time and later I gave the user details.
    And in Runtime work bench this error is not going away.
    Any help on this?
    Thanks
    chiru

  • Implementing  EHP4 in existing system ECC6 with EHP3

    Hi
    We are implementing the EHP4 in existing system ECC6 with EHP3.
    I got the following error on solution manager maintenance optimizer when calculating the queue.
    As per sap note : Note 1139602 - Several enhancement package releases on one system .
    Now, I am upgrading all the support packs in the system to the latest level of EHP3.
    While Import it encounter with DDIC_ACTIVATION
    TP_STEP_FAILURE
    Error message: OCS Package SAPK-60301INEAAPPL, tp step A, return
    code 0008.
    I have Upgraded the Kernel ann TP, R3trans to Latest but still have issue.
    Kernel Release: 700
    COuld you please advise.
    Thanks
    Anil

    >  We are implementing the EHP4 in existing system ECC6 with EHP3.
    > I got the following error on solution manager maintenance optimizer when calculating the queue.
    Which error?
    > As per sap note : Note 1139602 - Several enhancement package releases on one system .
    >
    > Now, I am upgrading all the support packs in the system to the latest level of EHP3.
    This is not necessary... you can go directly to EHP4.
    > While Import it encounter with DDIC_ACTIVATION
    >
    > TP_STEP_FAILURE
    >
    > Error message: OCS Package SAPK-60301INEAAPPL, tp step A, return
    > code 0008.
    >
    > I have Upgraded the Kernel ann TP, R3trans to Latest but still have issue.
    An activation failed. check the import log in SPAM to see which object is failing and for what reason (Goto - Import Logs - Queue).
    Markus

  • Flashupdater filling system.log with spew

    Has anyone else noticed that flashupdater is filling their system.log with spew? This is happening on systems with and without flash installed. Sign, yet another blunder...

    Linc Davis wrote:
    That's the Flash updater included in Mac OS 10.7.4. It doesn't work on a case-sensitive boot volume, which is what you have.
    com.apple.flashupdat...: Apple Support Communities
    Correct. See this post: https://discussions.apple.com/thread/3952378?tstart=0
    and change your com.apple.flashupdater.plist file. That should take care of it.

  • Load System Matrix with Data

    Hi,
    I like to fill system Matrix with data; please find the code below.
    Thank you very much for your good work and support.
    Thank you,
    Rune
    CODE
    #region SalesOrderItemLine_GetDataFromDataSource
    public void SalesOrderItemLine_GetDataFromDataSource( SAPbouiCOM.Form oForm, bool Matrix77_AddRefresh )
         try
              if ( Matrix77_AddRefresh )
    oForm.DataSources.DataTables.Add("SYS_77");
              oForm.DataSources.DataTables.Item("SYS_77").ExecuteQuery("SELECT [Code],[Name],[U_Weight],[U_PoNo],[U_CoopName],[U_Consignee],[U_PalGroup],[U_Container],[U_ItemCode],[U_CheckBoxSelect] FROM [dbo].[@MyTable] WHERE [U_MatrixAorB] = 'A' AND [U_WRKsalesOrderYN] = 'N'");
              ( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).Columns.Item("1").DataBind.Bind("SYS_77", "U_ItemCode");
              ( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).Clear();
              ( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).LoadFromDataSource();
              ( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).AutoResizeColumns();
         catch ( Exception Error )
              oApplication.MessageBox("Add-On Error-3232: = " + Error.Message, 1, "Ok", "", ""); // My Error Code
    #endregion

    Hi David!
    This is a Product Development Collaboration suggestion!
    I like to load data into system matixes...that could be really nice!
    (No my problem is still out there...
    Thank you,
    Rune

  • Deprecated system parameters with specified values:

    Hi ,
    I am getting below in alert log:
    Deprecated system parameters with specified values:
    remote_os_authent
    IS this parameter is suppotable in 11G and also how can i remove it from SP file with out bouncing the instance.
    thanks..

    1) It is deprecated in 11g as er your alert log message. http://docs.oracle.com/cd/B28359_01/server.111/b28320/initparams199.htm
    2) Set it in your spfile to FALSE which will reset this back to the default. This can't be changed dynamically and you will have to reboot your instance.
    alter system set remote_os_authent=false scope=spfile;

  • System boot with question mark ?

    system boot  with questio mark ?

    Reboot the machine and hold the option key down, select OS X to boot from and then in the System Preferences> Startup Disk, select OS X.
    Reboot and see if this works.

  • SAP BI System Copy with only Config changes, Not Data

    Hi BASIS,
    I have a requirement from a client to build a system landscape stratagy for their SAP BI system.
    We have DEV - QA - PRD systems for SAP BI (7.0 SP 16)
    Both DEV and QA are completely out of sync with PRD. We are doing development tasks directly on PRD. Now we have decided to re-sync the DEV & QA systems with PRD.
    'System copy with Data' will be easier to implement. But our PRD DB size is nearly 3TB. The client is not ready to pay for the extra/temp. disk space for DEV and QA sync. ( We are on DB2).
    Now, we have only one option left. Capture all Config changes from PRD and transport them back to DEV & QA. This is a tedious task and cause many inconsistencies.
    Would anyone have any other ideas to bring the systems in sync with less time involved and less resources.
    I am a SAP BI person. So dont know much about BASIS tasks. Please help me with any links of best practises or SAP notes.
    Cheers

    HI Reddy,
    We came to know from our basis team that we do not have the Java Stack installed in our BI 7.x system yet.
    As it is integrated with EP which has Java, our web reports are working.
    1) But my question is still do we ned to install the Java Stack in our BI system as i do not find any Export to PDF option in EP for the reports (eventhough AS Java supports this).
    2) Or can we use the existing configuration without Java STack integrated to EP for the new tools like Report Designer and Integrated Planning?
    Regards
    Kumar

  • How to verify the  Source systems connectivity with BWQ System.

    Hi All,
    I have diff source systems. And my requirement is to check the source systems connectivity with BWQ (BW Quality sys). please any body tell me the steps how to check the source system connectivity ?
    Thanks & Regards,
    Manju

    Hi Manjula,
    If you encounter problems when establishing a connection to your target server, check the following:
    A message box appears while performing one of the following actions:
          Setting connection by choosing Apply to local session.
          Testing connection settings by choosing Test settings.
          Creating SAP TSQL objects
    If errors occurred, they are displayed in the respective message box.
       Check developer trace files in ST11.
      Test connection:
         For RFC related errors, check the RFC connection via SM59
         For database multi-connect errors, check if you can connect to the target SQL Server with the SQL Server Query Analyzer. Also check if the DBCON entries are correct.
    Regards,
    RK

  • How to configure  a test sever with the system copy with prd data

    Dear All ,
    I need to configure  a test sever with the system copy with prd data.
    Please any one can suggest the step by step process to do the same configure and  system copy.
    Regards
    kumar

    Dear All,
    I am facing problem in system copy. I want to knoe the way after restore i  can move all the data and server data in one drive .
    Now the error is resolve by changing the initTAT.sap the value tape to disk but now stuck in the drive for restore it is asking which is not there at os level.
    BR0252E Function mkdir() failed for 'M:\oracle\TST\SAPDATA4\PRD33' at location
    BrDirCreate-1
    BR0253E errno 2: No such file or directory
    BR0252E Function mkdir() failed for 'M:\oracle\TST\SAPDATA4\PRD32' at location
    TO solve the above problem i have created ad network drive for this but once all the restore will be completed than how i can i move the data form network drive to on drvie.
    Please suggest
    Regards,
    Kumar
    Edited by: kumarmoh on Jul 21, 2009 1:43 PM

  • " SYSTEM ERROR" with ERROR CATEGORY: Message and ERROR ID : GENERAL

    HI all
    I m doing JDBC -> XI -> SOAP -> XI -> FILE ( XML) scenario .I have implemented it using  BPM .
    But ,In MONI , i am getting a "SYSTEM ERROR " with "ERROR CATEGORY : MESSAGE" and "ERROR ID : GENERAL" .and 
    One thing more is there my all adapters are active (JDBC,FILE) in runtime workbench but SOAP adapters i am not able to see it there as its services are not defined in there .Is this problem is because SOAP adapters are not defined in runtime workbench ?

    Hi Colin
    I are using SP 3.0
    I have checked the Communication channel monitoring and Adapter monitering also but in mine case when i want to see the SOAP adapter in adapter monitoring , the SOAP ICON is disabled there ,so i am not able to see whats the status of my SOAP adapter i have used in my scenario
    Thanks and Regards
    Abhishek

Maybe you are looking for

  • I'm at a loss with the onboard sound

    I can't get my 6 5.1 speakers to work on mt KT4 Ultra board, so I'm considering putting my Sound Blaster back in and disabling the onboard sound. What kind of a performance hit will I take? I can get the fronts to work, or the rears to work but not a

  • Recovery HD Locks, Unable to Repair Disk

    Experiencing a slow computer and erratic behavior I have run the disk utility.  Repair disk unavailable so ran Verify Disk.  It was unable to complete this process and directed me to restart the computer holding Control R until Apple logo appears.  T

  • IPod Video not connecting

    I have a 30gb iPod Video and when I plug it up to the cable nothing happens. Windows doesnt see it and neither does iTunes and the iPod itself doesnt light up when it's plugged in. But when I unplug the cable from the iPod(its still connected to the

  • Ranking for Row grouping in SSRS report

    Hi, I want to display data in following format in ssrs report.  Rank Group  Value 1        G1      10 2        G1      20 3        G1      30 4        G1      40 1        G2      25 2        G2      54 3        G2      64 I tried row count and other

  • Base Station confusion...

    Hello there, I've recently moved flat and have just been set up with a new ISP account... We (my girlfriend and I) have a G5 and a G4 powerbook connected to an Airport Extreme basestation (Firmware v5.6) both computers are on os10.4.7... After waitin