.bat file result not giving correctly in data services

Hi ,
I am using .bat file to count the number of files in the folder. I want to capture the value of the number of files.
I have written small .bat file as shown below
@echo off
setlocal enableextensions
CD %1
set cnt=0
for %%A in (*) do set /a cnt+=1
echo File count = %cnt%
endlocal
I have used this batch  file in the script as shown below.
$COUNT =exec('D:\\test.bat', 'D:\\docs',8);
print($COUNT);
In the above $COUNT is varchar(255).
actually i have only 11 file sin the docs folder . But it is giving the 442 files.
If I run the same batch file in the windows cmd command I am getting the correct result.
Please let me know what will be issues?
I am unable figure out the issues for weird result when I am using DS.
Please help me in this issue.
Thanks & Regards,
Ramana.

Hi,
While executing the batch file it is taking the Data services installation directory path as shown below.
14504    6420    PRINTFN    3/30/2015 9:40:10 AM    0: C:\Program Files (x86)\SAP BusinessObjects\Data Services\bin  File count = 442
I have changed the the batch file with two parameters. one for changing directory and another one for changing the folder.
Now my batch file looks like this.
@echo off
setlocal enableextensions
%1:
CD %2
echo %CD%
set cnt=0
for %%A in (*) do set /a cnt+=1
echo File count = %cnt%
endlocal
Then my script is like this .
$COUNT =exec('D:\\test.bat', ' D D:\\docs',8);
print($COUNT);
Now it is giving the expected result as shown below.
14700    13912    PRINTFN    3/30/2015 9:52:18 AM    0: D:\Docs  File count = 11
Thanks & Regards,
Ramana.

Similar Messages

  • Drill Down are not giving correct values

    Hi
    We created sales Order values as a character and putting them in Rows and populating data by writing update rule. We created variables on calendar month in order to choose specific period of data in the query. For example if we need 02/2008 to 0/42008 which gives two months of data. When I drill down on Sales Order or billing document on the report it’s not giving variable interval data instead it’s pulling all the sales orders and billing documents in the Cube. With out drilling down the values are showing OK.  If I restrict with same period in the cube it's giving correct values
    Please let us know if you have any ideas.
    Thanks
    Naga

    Aah, I guessed it correctly!
    Remove the local var of the Stop button & place the terminal itself inside the inner while loop & directly wire it to the conditional terminal of the outer while loop.
    Please see the attached pic...
    Message Edited by parthabe on 07-30-2009 07:12 AM
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    arrayreq_mod.jpg ‏97 KB
    arrayreq_mod.jpg ‏97 KB
    arrayreq_mod.jpg ‏99 KB

  • Some photos are not sorted correctly by date

    I just imported some photos from my friends camera who were on the same trip. However, I noticed that a couple (not all) of his photos are not sorted correctly by date in the Event. A photo from day 3 somehow comes before the photos from day 2. I checked the extended information and the dates on the photo are correct. Has anyone had this problem and know of a solution? Thanks.

    It might be of some help to delete the photo cache. Please see this link - http://support.apple.com/kb/TS1314

  • I have an Apple Configurator install that wont recognize an iPad when I attach it via USB.  I cant prepare it or refresh it.  It was supervised.  I get an error message that says "policy does not have correct profile data".  Please help!!!

    I have an Apple Configurator install that wont recognize an iPad when I attach it via USB.  I cant prepare it or refresh it.  It was supervised.  I get an error message that says "policy does not have correct profile data".   At some point there was a mismatch between the profile on the iPad and the MAC server.  The profile on the MAC server has been deleted and the iPad has been erased and reset to default.  I need to be able to get Configurator to recognize this device to prepare it for deployment and issue Apps to it.   Please help!!

    Run the application 'Terminal.app' which you will find in '/Applications/Utilities' on your Macintosh.
    Type this into it: defaults delete com.apple.configurator PreprationSavedPolicyDefaultsKey
    Hit the return key.
    If you get no error message, it worked, and you can quit the app.

  • My music file did  not download correctly and stops playing after a few seconds.

    My music files did not download correctly from itunes and stop playing after a few seconds.

    Assuming you are in a region where you are allowed to redownload your past purchases, delete the current copies from your iTunes library and then download again from your purchased history. If the problem persists, or that facility is not available in your region contact the iTunes Store support staff through the report a problem links in your account history.
    tt2

  • FOX CLOCKS not giving correct time. Central time is 2 hours ahead of the actual time

    FOX CLOCKS not giving correct time. Central time is 2 hours ahead of the actual time

    sorry not an Atomic clock issue I read your post wrong
    actually last night I tried to set my clock back to the time without Daylight savings and it would only let me set it to 1 or 3 am but not 2.. I noticed this, but I would wait till Sunday is over and see if this bug is only a one day issue which I have a feeling it may be, wait till 3am march 10th and see if this bug fixes itself I have a feeling it will

  • Apple Configurator: "Policy does not have correct profile data."

    I keep getting the message "Policy does not have correct profile data." when I'm trying to prepare new devices in Apple Configurator 1.2.  Existing devices work fine, and I was able to prepare a few new devices before getting this error.  Any advice besides "wipe and restart" AGAIN?

    defaults delete com.apple.configurator PreprationSavedPolicyDefaultsKey
    should eliminate the problem, though it will partially reset the default settings in the Prepare pane. Did you delete a configuration profile that had been checked in the Prepare settings?

  • Quiz Results Analyzer results not displaying correctly

    We are using Adobe Captivate 6 and posting quizzes to a local server (configured with the .php files.) When we review quiz results using the Quiz Results Analyzer, some of the data is correctly reported. However, the Pass/Fail is not working right (either everybody who takes the quiz passes, or everybody fails.) Also, we are not seeing a total score.
    Is there any tutorial for correctly configuring all of the quiz preferences, so that we get the results we are looking for?

    Thank you for the link. I have viewed this video in the past.
    The issue I'm having is that, in spite of setting the the quiz options for reporting, the data that is received in the xml files is not correct, therefore, it is not being correctly summarized in the Quiz Results Analyzer.
    (It would also seem that the screen name I set here is not retaining its modifications.) 

  • Websites not loading correctly, clock date wrong

    Yesterday I noticed the clock on my computer was 3 hours behind and the date 4 years ahead. Since then any attachments in Gmail come up with a warning as it not being trusted. Also gmail's buttons
    ( delete, spam, move etc) do not load the words. Then facebook does not load correctly it almost looks like html code. I have checked all settings your site has recommended. I do not have any add-ons or adblock, have cleared all cache, cookies history etc. I have all required and suggested items checked but nothing is working. Any other ideas, appreciated

    Try to rename the cert8.db file in the Firefox profile folder to cert8.db.old or delete the cert8.db file to remove intermediate certificates that Firefox has stored.
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox

  • Stock transfer are not showing correct expire date for Shelf life subcontracting

    Hi Gurus,
    We have shelf life active for PPDS. We had added 5 characteristic to have min and Max shelf life in APO so that data will be considered during pegging.
    Self life works perfectly fine for production plant where based on manufacture date min shelf life is considered.
    LOBM_APO_SL_MIN
    LOBM_APO_SL_MAX
    LOBM_APO_SL_UTC
    LOBM_VERAB
    LOBM_HSDAT
    Question is for sub contracting process stock or inventory date is giving back dated where when we run planning run stock is getting expired.
    Can any one help in getting stock correct expire date instead of 1982---- some thing like this.
    Thanks in advance
    Thanks & Regards,
    Rajesh Kumar

    When you plan subcontracting in SNP following is generated.
    Object                             Source                                   Destination
    Sub Con PR (Header)       Sub contractor                       Plant
    PR/STR (Child)                Plant                                     Subcontractor
    PR (Child)                       Child Mat Vendor                    Plant (or direct to Sub Contractor)
    Usually first and third items will get converted to Purchase orders and will vanish as and when Goods Receipts are posted against them.
    The second order may not get converted in SAP.  Tis will remain in the system.  But in the next planning run, these will be deleted if the quantities have been already fulfilled.
    Regards
    Nitin Thatte

  • Offline Files Do Not Sync Correctly or Show Error

    I have a problem with files not syncing correctly and not showing errors.  The client station is running Windows 7 Professional Version 6.1 Build 7601: Service Pack 1).  A clear example of the problem is listed below:
    On January 9 the laptop was connected to the server with the shared folder.  Three files in that folder were open (in Notepad) on another computer running Windows XP.  That computer does not have offline access setup for any folders.
    After the files were closed on the Windows XP computer, the Windows 7 computer was shut down and physically disconnected from the network.
    On January 10 I was working offline with the Windows 7 computer and noticed that the files did not include the changes made on January 9.  Since the changes were minor, I was not concerned and continued working offline for several days.
    When I returned to the office on January 20, I reconnected to the network and opened the Sync Center expecting to see sync errors for the files in question, instead the conflict Window showed "There are currently no sync conflicts."
    When I attempted to open the files, I found they were the version saved from the Windows XP computer on January 9.  I quickly disconnected the Windows 7 computer from the network and was able to find the offline version of the files in the \Windows\CSC
    directory and copied them to another location.
    What causes this error and what steps can I take to ensure all sync problems are displayed, instead of having the system revert to out of date files without warning me?
    Thanks for your help

    Hi,
    I noticed that when the files finished on Windows XP PC, Windows 7 PC is not connected to the network, and Windows 7 PC was stayed offline(No connection to the network folder) until January 20,
    right?
    If I understand correctly, the files on Windows 7 PC have no connections to perform a sync. On Windows 7,
    Background Sync runs at regular intervals as a background task to automatically synchronize and reconcile changes between the client computer and the server. IT administrators can configure synchronization intervals and block out times. With
    this feature, users no longer must worry about manually synchronizing their data with the server when working offline.
    More details, please check the below MS articles:
    What's New in Offline Files
    How the synchronization in Windows 7 Offline Files works
    How to schedule Synchronizations in Windows 7
    If any further assistance needed, please feel free to contact us.
    Best regards
    Michael
    If you have any feedback on our support, please click
    here.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Sorting not working correctly for date field in alv report

    Hi All,
    My report displays many rows also containing date type fields of bldat,budat .
    When I sort the report selecting field of type bldat budat the sorting is not correct for the year.
    Ex:
    Invoice doc dat
    01-25-2011
    01-21-2011
    02-02-2011
    10-25-2010
    11-20-2010
    If I use ascending then it is sorted as :
    Invoice doc dat
    01-21-2011
    01-25-2011
    02-02-2011
    10-20-2010
    10-25-2010
    Why the sorting is not working correct for year.(2010 records should have been first).
    The field wa_tab-bldat is of type char10.
    It is populated as wa_tab-bldat = bsak-bldat.
    Kindly suggest what can be done.

    The field wa_tab-bldat is of type char10
    Then what it does is correct.
    Refer to type datum...it will work

  • Stock Ledger Report in Day Wise not giving correct values for Opening Stock

    Dear Experts,
    I m working on Sock ledger report to give the day wise data.
    since yesterdays closing Stock will become opening stock of today,
    To get Opening Stock,
    I have restricted the stock key figure with 2 variables on calday        
                                  (DATE FROM var with <=(Lessthan or equal to) and offset -1
                                   DATE TO      var with <=(Lessthan or equal to) and offset -1)
    To get Closing Stock,
    I have restricted the Stock key figure with 2 variables on calday        
                                  (DATE FROM var with <=(Lessthan or equal to)
                                   DATE TO      var with <=(Lessthan or equal to) )
    But in the output Opening stock values are not coming correctly and for given range of dates,
    for last date, opening stock is showing as Zero.
    Could you please tell me how can I achieve the correct values for opening stock.
    Thanks in advance.

    Hi Arjun,
    Seems like you are making it more complicated. What is your selection screen criteria?
    Ideally you should only use the offset.
    You will have say Calday in rows and stock in Column
    ____________Opening Stock_____________Closing Stock
    01/06/2009___(Closing stock of 31/05/2009)_(Stock of 01/06/2009)
    02/06/2009___(Closing stock of 01/06/2009)_(Stock of 02/06/2009)
    03/06/2009___(Closing stock of 02/06/2009)_(Stock of 03/06/2009)
    So, from above scenario, create one RKFs and include Calday in it. Create a replacement path variable on calday and apply the offset as -1.
    So, your Opening Stock will be calculated by closign stock of previous day.
    - Danny

  • Adobe Illustrator file will not display correctly when logged in as a user

    I am working with an Adobe Illustrator CS2 file that will open and display correctly if I log in as Administrator, but will not display correctly if I am logged on as a user. The error message is that there is not enough memory to display the file correctly and I am forced into preview mode. The user Home folder is on a server. Other than this, I have made certain that the criteria for opening the file match under both interfaces. I have opened the AI CS2 file on other Macs and it opens fine. I conclude that the problem is with the user Home folder, but beyond that, I'm stumped. Any help will be appreciated.

    After I filed a bug-report an Apple engineer contacted me, and asked me to try running java in headless mode: http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/
    That solved the problem!

  • Files Are Not Transferring Correctly from Captivate 4 to 5

    My files from Captivate 4 are not transferring correctly into Captivate 5.  The images and quiz questions are not in the same place. Help!

    This is a bug.
    We all have it.
    Keep CP4 for the old courses, and develop new ones in CP5. That is what I am doing.
    Alternative is to manually adjust everything (don't even get me started on rollovers...)
    Terry

Maybe you are looking for

  • A Freeze-up that I can't fix.

    Ok, so I have been having a problem that appears similar to the lookupd problem that many people have discussed here and on other Mac forums. I have a brand new Dual 2.3 G5, and it has worked fine for a week and a half, performing with wonderful spee

  • EPM 11.1.2 Version Migration.....

    Hi, I installed 11.1.1.3 on Red Hat Enterprise Linux 5 with SQL database of version 2008 ,Manual deployment of Web Sphere 6.1 version.And external directory(Microsoft Active Directory) has been configured well but the issue here is I am unable to ref

  • How to find my ipod touch.

    how can i find my ipod touch?

  • Change PNP standard selection screen attributes

    Hi experts, I need to change the standard PNP selection screen parameter BUKRS into "obligatory". I know it can be done for all reports using PNP through SPRO, but I need it only for one customer report. Best regards, A. Cepa.

  • Why Such a Huge Photoshop File Size Increase When Saving In CC from other versions?

    Hello, I have limited experience in Photoshop, and am working with a file with two other people.  We are creating web comic pages.  The line artist and colorist are both using CS 6.  I have CC.  The file I receive from them is around 238MB.  If I ope