Execution of a batch file fails if the batch file has a date

Hi All,
I have a batch file which copies files from one folder to another based on the date condition( if the files are modified or created today copy them). Below is my code
set curr_date=%DATE:~4,2%/%DATE:~7,2%/%DATE:~10,4% & XCOPY \\cambosnapp01\FileTransfers\InboundToHomesite\NICB\Entities \\cambosnapp01\Claims\Analytics\NICB\CurrentAlerts/d:%curr_date%
This batch file runs fine if i run it manually, but i want to run this in an ssis package, i am using an execute process task and in the executable i gave the location of this batch file, and if i run the package it fails.However if i just exclude the last
date thing from the batch file and run the below one it runs fine.
set curr_date=%DATE:~4,2%/%DATE:~7,2%/%DATE:~10,4% & XCOPY \\cambosnapp01\FileTransfers\InboundToHomesite\NICB\Entities \\cambosnapp01\Claims\Analytics\NICB\CurrentAlerts/d
But this batch file would copy all the files which i dont need. I only want to copy the new files and thats the reason i use the date in the end but for some reason it fails.
Can someone please help me with any suggestions on this?
Please let me know if you have any questions or if i am still unclear.
Thanks

What is the error you are getting?
Why don't you want to use the FileSystem task that is parameter driven?
Running the bat file manually vs as a package has a difference.
Do you run it while the package is in development (via SSDT)?
You only gave the bat file, but how did you set your task in SSIS not.
Arthur
MyBlog
Twitter

Similar Messages

  • HT1364 when I click on consolidate files I get a message that says "Copying files failed. The required file could not be found" what does this mean?

    I've been encountering problems with this from the beginning, when I realized that my iTunes media folder was engulfing most of my storage. I bought an external drive, followed all the steps, and since then I've lost 1 movie and several songs, and now I've lost some magical file that means I can't move anything now. The files are still on my computer (I moved them back after losing the movie and songs) and I can't move the media files. It does create the folders for me all the way down to the artist and album BUT when I open that last folder it shows me NOTHING! please help this is incredibly frustrating.

    1. delete this songs from your liblary
    2. go File -> Add File to Liblary... (Ctrl+O) or File -> Add Folder to Liblary

  • HT1751 Consolidating files failed.  The file name was invalid or too long.  How to trouble shoot this?

    I am trying to move my iTunes library from old XP PC to Windows 7 PC, using an external hard drive.  Using tutorial and signed in as administrator.  Trying to consolidate my library and receive error message " Copying files fail. The file name was invalid or too long".    Don't know what to do as next step.   The library is sitting on the hard drive under the Administrator ID (My Documents\My Music\iTunes\iTunes Music).  
    Any thoughts?

    You can select a group of tracks and consolidate from the right-click context menu. You coud try consolidating in batches, say all songs by artists beginning with A, then B, etc, then the other media types, until you can isolate a problem track and then try moving that by hand and fixing the broken link.
    I also have two scripts that could help you, Unconsolidated and ConsolidateByMoving. The first can make a playlist of all unconsolidated tracks, the second can consolidate a selection of tracks by moving them instead of copying.
    tt2

  • HT1751 Consolidating ITunes Library Failed - message received: "Copying files failed. The file name was invalid or too long" . Please help - how to i fix this issue?

    I consulted your website for details on how to back up my ITunes Library on my PC-found the article very helpful-I reached step 7 - clicked ok and the following message came up: "Copying files failed. The file name was invalid or too long."  Please can you help and advise what I should do or how to fix this issue.   My pc operating system is Windows 7 Home Basic

    You can select a group of tracks and consolidate from the right-click context menu. You coud try consolidating in batches, say all songs by artists beginning with A, then B, etc, then the other media types, until you can isolate a problem track and then try moving that by hand and fixing the broken link.
    I also have two scripts that could help you, Unconsolidated and ConsolidateByMoving. The first can make a playlist of all unconsolidated tracks, the second can consolidate a selection of tracks by moving them instead of copying.
    tt2

  • UBE: Retrieve of UBE file failed. The file may not exist on Enterprise Serv

    Hi,
    I'm getting the following message in my pdf file , after running the batch R3465 :
    UBE: Retrieve of UBE file failed. The file may not exist on Enterprise Server.
    What does that mean ? Can anyone help ?
    Thanks,
    thiensu2810

    Thank you for your good suggestion. Here is what the new home folder permissions looks like:
    Last login: Fri Dec 22 14:45:24 on ttyp1
    Welcome to Darwin!
    Louise-Heifetzs-Computer:~ joy$
    Louise-Heifetzs-Computer:~ joy$ id
    uid=503(joy) gid=503(joy) groups=503(joy), 81(appserveradm), 79(appserverusr), 80(admin)
    Louise-Heifetzs-Computer:~ joy$ ls -ln
    total 0
    drwx------ 3 503 503 102 Dec 16 18:39 Desktop
    drwx------ 3 503 503 102 Dec 16 18:39 Documents
    drwx------ 22 503 503 748 Dec 16 18:45 Library
    drwx------ 3 503 503 102 Dec 16 18:39 Movies
    drwx------ 3 503 503 102 Dec 16 18:39 Music
    drwx------ 4 503 503 136 Dec 16 18:39 Pictures
    drwxr-xr-x 4 503 503 136 Dec 16 18:39 Public
    drwxr-xr-x 7 503 503 238 Dec 16 18:52 Sites
    Louise-Heifetzs-Computer:~ joy$ ls -ln /Users
    I see the differences between the two, but am not sure how to proceed. I feel in over my head and would be grateful for guidance. Many thanks.

  • ITunes v10.6.1.7 "Copying files failed. The File name was invalid or too long."

    I'm trying to organize my music files using iTunes 10.6.1.7 and I keep getting the error message "Copying files failed. The File name was invalid or too long."
    I've got music folders by artist in both the iTunes Music folder and the iTunes Media/Music folder. When I add certain files by drag/drop they sometimes get lost and I don't want that to happen anymore. I used to just consolidate my music files using the File/Library/Organize Library option and that worked, however now when I do that, I get the error message.
    I'm a novice and the only online stuff I see is both confusing and refers to earlier versions of iTunes.
    My concern is that I have heard that people lose entire libraries of their music when they trry to fix things like this and I don't want that. If this is of any importance, I have several files called iTunes library and temp library. I have no idea what that all means but I'm scared to death of it.
    Also, I can't get to the "re-organize library" link at all. It won't let me.
    One thing that be of some interest is that when I pull up the properties of the music and media/music files they are marked "read only" I'm also afraid to touch that!
    Please help and please know that I am a dummy. Be kind and be clear. Step by step would be great, with images even better. Thanks.

    Perhaps nobody knows the answer? We're fellow users here answering questions in our free time when we think we've something useful to contribute.
    You can choose to *Consolidate selected tracks* with a right-click menu. Perhaps if you can identify a specific track that won't consolidate and examine the full path to the file & the path that iTunes would create when it consolidates the problem might become apparent. For example iTunes may not be able to move files if the source or destination path length exceeds 255 characters.
    tt2

  • Moving library to external hard drive and get the error "Copying files failed. The disk could not be read from or written to"

    Hello,
    I'm moving my library to an external hard drive.
    I've made sure to use the 'Keep iTunes Media Folder Organized' option when pointing to the new library location.
    I select 'File'->'Library'->'Organize Library', I select to 'Consolidate Files', click 'OK' and get ther error message "Copying files failed. The disk could not be read from or written to".
    I've read elsewhere that there may be a corrupted file that I need to sequester somehow and perhaps add it back however I'm not certain how I can locate that file because the status window doesn't indicate which file it's attempting to transfer when the error appears.
    Any tips?
    Thank you,
    Greg H
    iTunes 10.6.3

    OK I figured it out!
    It was a dodgy file....I sorted the file folders by date, and as it turned out within the "compilations" folder there was a CD where only about half the tracks seemed to have been copied over. Could not have identified this simply from the time indicated on the finder folder sort, because there were several CDs copied over in the that same minute.
    I went back to the original itunes folder, deleted all the files from that CD in itunes, then also deleted all those files from the original disk and the target disk.
    Tried the "consolidate library" again, and it completed nicely. 200megs of music and videos.
    Very happy to solve this problem after 3 weeks.

  • When trying to 'Consolidate Files' via iTunes I get the message "Copying files failed. The name was invalid or too long."

    I am trying to copy my entire iTunes library and everything in it from my PC Desktop to my PC Laptop using the "External Drive" method as shown on the Apple website. On Part 1 (5) I am told to consolidate files. When attempting to do this I get the message "Copying files failed. The file name was invalid or too long."
    How do I resolve this?

    I have just been having this problem and it has been driving me mad.   The error message doesn't tell you which file is causing the problem so you can't fix it and it leaves your libray in a state of limbo with some files copied into the new location and some in the old location.  After many hours I found a surprisingly quick and simple solution.
    1) in iTune create a smart play list that includes everything that was added before tomorrows date.  This will include everything.
    2) Right click this playlist and export it as a text file to produce a tab delimited file.
    3) Import this into a spread sheet, or just view it in a text editor with line wrap turned off.  What you are interested in is the last column (or end of the line in a text editor).  This gives you the path of the file associated with each entry in the library. 
    The path of the files that have already been copied successfully will start with the new location for your media files you specified.  Scroll thru the rows until you get a blank path.  If you start getting paths starting with the old Media file location then you went to far and start scrolling back.
    The row with the blank path was the file that failed.  Move back to the start of the row to find out more about it.  In my case it was a podcast with a very long name. I just deleted that podcast from iTunes.
    4) Restart the consolidation by choosing File, Library as you did before and the process starts again where it left off.
    5) If it fails again on another file just repeat the process

  • Consolidate Problem. Copying files failed. The File name was invalid.

    Hi to everyone,
    My system is 10.5.8, iTunes 9.2.1 (4)
    I tried to consolidate my iTunes library to an external HD. After about 100GB of copied music, I got the message : Copying files failed. The File name was invalid.
    Now everytime I try again to consolidate, I get immediately this message. I am looking everywhere for a solution, and I only find the same problem for Windows iTunes users.
    Actually I found very useful this thread:
    http://discussions.apple.com/thread.jspa?threadID=1708372,
    which talks about with which order iTunes consolidates the media, so by digging a little in the folders to find which track has the problem and make the fix. It says that consolidate start copy the files by the date added order. So I can go in my new iTunes media folder and find the latest added track, then go back in iTunes, sort by date added the songs and locate the next song, to make the fix. However in my case, all previous and next songs (by date added), have been copied in the new locations.
    I am stuck. I have a remaining 300GB of music to consolidate and dont know how to proceed.
    Any help would be much appreciated..

    Finaly, I managed to solve it by myself...,
    following the help I found from the post of the thread I mentioned on my question...
    What was the problem that made things more difficult in my case, is that a big amount of songs have been added at the same time, with just a few seconds time distance. So it was tougher to locate what was the last imported song, and where iTunes consolidation had stopped. Actually I had groups of about 100 songs with the same timestamp of date added and the consolidation was following the rule of the "date added" but not exactly with the order the songs was showing in the iTuned library. So I started checking all the songs very close to the last added in the media folder one by one with the "show in finder" command, and then I managed to found what was the one with the problem.
    Regarding the problematic file, that was a midi file that had been imported in my iTunes.
    I hope this will help anyone else that might have the same problem as me in the future.

  • I am using itunes 10 and trying to consolidate my files.  I keep getting the error "Copying files failed.  The file name was invalid or too long".  How can I indentify what file is causing this problem or resolve this issue?

    I am using itunes 10 and trying to consolidate my files.  I keep getting the error "Copying files failed.  The file name was invalid or too long".  How can I indentify what file is causing this problem or resolve this issue?

    BUMP
    Yes, I just get that message. I don't see how I could investigate this problem.
    I didn't mention that this happened when I was consolidating my library, not copying files to another computer.
    In other words, I'm using a "normal" itunes procedure, itunes won't complete it, and won't tell me exactly why or how to figure out how to fix it...
    Is there at least some easy way to tell which files were successfully copied to my itunes music folder so I can work on moving the uncopied files?
    Can anybody help me?

  • Error(12,61): Parse of component type files failed, check the adf-config

    I got this error when i wanted to deploy CreditCardValidation
    Error(12,61): Parse of component type files failed, check the adf-config.xml file : "java.lang.reflect.InvocationTargetException"

    I got this error when i wanted to deploy CreditCardValidation
    Error(12,61): Parse of component type files failed, check the adf-config.xml file : "java.lang.reflect.InvocationTargetException"

  • HT1449 Help! This all runs quite smoothly until i get to 'consolidate library'. Then, tracks start copying, then stop followed by a pop up saying 'Copying files failed. The disc could not be read from or written to.'  Any suggestions? Thank you!

    Help! This all runs quite smoothly until I get to 'consolidate library'. Then, tracks start copying, then stop followed by a pop up saying 'Copying files failed. The disc could not be read from or written to.'  Any suggestions? Thank you!

    I had similar problems, it was a nightmare and on a 3 month ipod too!. I use a Powerbook G4 at home and a G5 at work - both were returning the same problems. so I sent it off to apple, they quickly sent it back saying there was nothing wrong with and it didn't need to be repaired. I tried it again and the same problems occurred "disc cannot be written to or read from." I could copy 20 songs onto it at the very most. A couple of guys at my work suggested updating it on a PC, then adding tunes via my mac as normal - guess what!? it works a treat!?. How ridiculous is that!? an Apple product works best on a PC. these generations of ipods are obviously designed to work best on Intel based Macs. What is wrong Apple? are you abandoning the G-generation!? still, atleast my ipod works for now - it will prove a problem when I have to update the iPod's software since I don't own a PC or an intel-based Mac.

  • How can I make a droplet save a modified file next to the original file?

    I am having a problem getting a Photoshop Droplet save a modified file next to the original file. That is, when I drag a file "page_6.pdf" from some directory onto my droplet, I want it to do its work and save a modified "page_6.psd" in that same directory.
    This isn't working for me on Photoshop CC 2014 on Mac OS 10.10.
    I have an Action which has an Open command, with the filename "page_1.pdf". Then it has a bunch of editing commands. Then it has a "Save As... Photoshop format" command, and a Close command. When I run this action within Photoshop, it brings up Open and Save As dialogues, and works fine.
    In creating the droplet, I used File... Automate... Create Droplet..., and selected the following options:
    Override Action "Open" commands
    Destination menu value = Folder
    Using Choose... button, select an output folder, Directory_1/ .
    Check Override Action "Save As Commands" is checked
    For File Naming, I use [Document Name] + "_deleteme" + [extension]
    When I drag a folder, say "page_5.pdf" from some directory onto the droplet, Photoshop runs the Action on the document. However, it saves the modified document in Directory_1/, regardless of where the original file came from. And it always names the modified document "page_1_deleteme.psd", instead of using the Document Name of the original file.
    If I modify the Open command in the Action to mention a different file, then the droplet always names the modified document with that name. It's as if Document Name in the File Naming dialogue always reflects what's in the Open command in the Action.  But -- I asked the droplet to Override Action "Open" commands!
    When I set the Destination menu value to "Save and Close", then when I drag a file onto the droplet, the droplet opens a File Save dialogue and forces me to tell it where to store the file.  I don't understand this behaviour, and have a hard time reconciling it with the documentation at Photoshop Help | Processing a batch of files .
    (Interestingly, when Destination menu value = None or Save and Close, Photoshop displays an alert about overwriting an existing droplet when I click OK to save. But when Destination menu value = Folder, there is no alert about overwriting existing droplet.)
    How can I set up a droplet so that it writes the modified file in the same directory as the original file, and with the same root filename, but a different extension to reflect the different output file format?
    Has anyone else made a droplet behave this way on Photoshop CC 2014 on Mac OS X 10.10?
    Thanks in advance for your help.

    Thanks for your insights.
    Does my Action need to include an Open command?  I sure thought so, because of how the Photoshop Help | Processing a batch of files documentation describes 'Override Action “Open” Commands'.
    "...If the action contains an Open command that opens a saved file and you don't select this option, the Batch command opens and processes only the file you used to record the Open command..." I don't want to operate only the file I used to record the Open command. However, this sentence doesn't say that an Open command should be part of a droplet Action.
    "...Deselect this option if the action was recorded to operate on an open file..."  Maybe I if I rethink my Action as operating on an open file, then the Droplet will take care of the Open for me.  However, I have less control over the options the droplet's Open command uses.
    I'll try disabling the Open command, and create a Droplet with that.

  • Different log file name in the Control file of SQL Loader

    Dear all,
    I get every day 3 log files with ftp from a Solaris Server to a Windows 2000 Server machine. In this Windows machine, we have an Oracle Database 9.2. These log files are in the following format: in<date>.log i.e. in20070429.log.
    I would like to load this log file's data to an Oracle table every day and I would like to use SQL Loader for this job.
    The problem is that the log file name is different every day.
    How can I give this variable log file name in the Control file, which is used for the SQL Loader?
    file.ctl
    LOAD DATA
    INFILE 'D:\gbal\in<date>.log'
    APPEND INTO TABLE CHAT_SL
    FIELDS TERMINATED BY WHITESPACE
    TRAILING NULLCOLS
    (SL1 DATE "Mon DD, YYYY HH:MI:SS FF3AM",
    SL2 char,
    SL3 DATE "Mon DD, YYYY HH:MI:SS FF3AM",
    SL4 char,
    SL5 char,
    SL6 char,
    SL7 char,
    SL8 char,
    SL9 char,
    SL10 char,
    SL11 char,
    SL12 char,
    SL13 char,
    SL14 char,
    SL15 char)
    Do you have any better idea about this issue?
    I thought of renaming the log file to an instant name, such as in.log, but how can I distinguish the desired log file, from the other two?
    Thank you very much in advance.
    Giorgos Baliotis

    I don't have a direct solution for your problem.
    However if you invoke the SQL loader from an Oracle stored procedure, it is possible to dynamically set control\log file.
    # Grant previleges to the user to execute command prompt statements
    BEGIN
    dbms_java.grant_permission('bc4186ol','java.io.FilePermission','C:\windows\system32\cmd.exe','execute');
    END;
    * Procedure to execute Operating system commands using PL\SQL(Oracle script making use of Java packages
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    try {
    String[] finalCommand;
    finalCommand = new String[4];
    finalCommand[0] = "C:\\windows\\system32\\cmd.exe";
    finalCommand[1] = "/y";
    finalCommand[2] = "/c";
    finalCommand[3] = command;
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    new Thread(new Runnable() {
    public void run() {
    try {
    BufferedReader br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("Process out :" + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    catch (IOException ioe) {
    System.out.println("Exception caught printing process output.");
    ioe.printStackTrace();
    }).start();
    new Thread(new Runnable() {
    public void run() {
    try {
    BufferedReader br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("Process err :" + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    catch (IOException ioe) {
    System.out.println("Exception caught printing process error.");
    ioe.printStackTrace();
    }).start();
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    public static boolean isWindows() {
    if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1)
    return true;
    else
    return false;
    * Oracle wrapper to call the above procedure
    CREATE OR REPLACE PROCEDURE Host_Command (p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    * Now invoke the procedure with an operating system command(Execyte SQL-loader)
    * The execution of script would ensure the Prod mapping data file is loaded to PROD_5005_710_MAP table
    * Change the control\log\discard\bad files as apropriate
    BEGIN
    Host_Command (p_command => 'sqlldr system/tiburon@orcl control=C:\anupama\emp_join'||1||'.ctl log=C:\anupama\ond_lists.log');
    END;Does that help you?
    Regards,
    Bhagat

  • No manual entry of batch, if batch determination fails to pick batch in DO

    Dear Experts,
    I have a scenario, where I want system to stop users to pick batch manually in Delivery order creation (VL01N), if batch determination procedure fails to auto-pick batch due to any reason.
    By standard configuration, is there any-way to cater this requirement or we need user-exit only?
    PLease suggest.
    Regards,
    Praveen

    Hi Praveen
    The standard SAP allows you to change manually determined batch. When the batch is selected manually, the automatic determination has failed because the batch characteristics are not proper as per the condition set in VCH1. When you manually select the batch in the delivery, then the system would throw up a message saying Invalid batch (batch number) according to selection criteria in batch determination (Message no. VL215). This is a warning message. Try changing this to an error message in the user exit.
    Thanks
    Indranil

Maybe you are looking for

  • Director movie doesn't work online in Firefox

    When I publish movie it works fine locally both in Firefox and IE. But when I upload it to the server it works fine only IE, in Firefox it freezes during execution and I can't figure out what causes that. The movie loads external 3D model and XML thr

  • Issues downloading the 5.0 software for the iPhone 3GS. Any suggestions?

    Issues downloading the 5.0 software for the iPhone 3GS. Any suggestions?

  • IPhoto won't download all photos on card

    iPhoto was working great. Then I upgraded to Tiger (10.4.3), and my photos on my photo card will not all load. If I have 175 jpeg's on card, it loads to maybe 105 or 110 then quits (it's gone down to as low as 94 remaining). The whole program quits.

  • 1z0-052 preparation and real practice...

    Hello. I have successfully passed SQL Fundamentals I exam recently and my new aim is Administration I. I purchased necessary 1z0-052 exam guide by John Watson, however without practice it is impossible to neither get skills nor pass exam. Will it be

  • Missing "Raw Decode Presets.plist" file

    I'm having and issue with tint shifting when using the white balance brick. Several users have suggested deleting the Raw Decode Presets.plist however; that file is not located on my computer. How do I get Aperture to regenerate the list? Can somebod