Operating system command to zip the file

Hi Experts,
I got proxy to file scenario, i can place the text file successfully in reciever side, i want to zip the file in reciever side using operating system command option in reciever Communication Channel.
Can anyone please give me the operating system command to create the zip file in reciever side.
Kind Regards,
Praveen.

Hi Praveen,
>>Can anyone please give me the operating system command to create the zip file in reciever side.
Why OS commands and not the PayloadZipModule?
If you need OS commands check this blog of Michal /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
Update
You can try this command too
cmd /C "jar cMf \\<folderpath>test1.zip \\<folderpath>*.*"
Regards
Suraj

Similar Messages

  • File Adapter 7.11 - set operating system command line dynamically

    Hi,
    is there any way to set the "Operating System Command Line" in the file adapter as ASMA / dynamic attribute?
    I need to set  a command line exec depending on some XSL mapping values.
    thx
    holger

    hi,
    >>>is there any way to set the "Operating System Command Line" in the file adapter as ASMA / dynamic attribute?
    >>>I need to set a command line exec depending on some XSL mapping values.
    think about this approach:
    you put the XSL values into the filename after the real name of the file
    in the batch script you use those values in order to execute a dynamic exe command
    after processing you just change the name of the file in the script by removing the xsl values
    simple ? I think so
    Regards,
    Michal Krawczyk

  • Run Operating System Commands

    Hi,
    There is an urgent requirement, i want to know about Run Operating System Commands in file adapter. What are all possible commands for windows operating system? and how it works? Kindly send me your suggestions and links at the earliest.
    Your help will be appreciated.
    Thanks,
    Sadhna.

    Hi,
    Run Operating System Command Before/After Message Processing
    &#9679;      Command Line
    An operating system command specified here is executed before or after the message processing of a file that was found in a run. The default value is an empty character string (no command).
    When the operating system command is called, the file name currently being processed can be specified with the following placeholders:
    &#9679;        %f (file name)
    &#9679;        %F(absolute file name including path)
    &#9679;      Timeout (secs)
    This specifies the maximum runtime of the executing program in seconds. When this time interval is exceeded, the adapter continues processing. The executing program continues to run in the background.
    &#9679;      Terminate Program After Timeout
    Set this indicator if the adapter is to terminate the executing program when the timeout is exceeded.
    The adapter writes the output (STDOUT and STDERR) for the operating system command in the system trace.
    Regards,
    Phani

  • Problem in execution of Operating System Command

    Hi
    I am trying <b>OS command in Reciever File Adapter</b> but the command is not executing.In my scenario i am creating a file by reciever adapter and then this OS command will delete,rename..etc to this file.For this i had created a <b>Batch file</b> in which i had given OS commands, so once this batch file will execute the command should work.File is getting created but OS command is not executing.I am giving the command in the adapter as follows:
    <b>//Server-name/directory/Test.bat</b>
    i had tried giving command like this also
    <b>D:\directory\Test.bat</b>
    but there is no result.i read somewhere that this function works on SP9 or above.We are also working on SP9 but.....
    Do i have to make some settings for this function.
    If you have some solution then please help me.
    Thanx in advance.
    Regards
    Arpit Seth

    Hi,
    In help.sap.com (http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm), it is given as
    When the operating system command is called, the file name currently being processed can be specified with the following placeholders:
    · %f (file name)
    · %F(absolute file name including path)
    Are you using like this?
    rgds,
    Sasi

  • RUN OPERATING SYSTEM COMMAND BEFORE MESSAGE PROCESSING

    hi.
    just i want to know what is the purpose of run operating system command before message processing,after message processing under file sender adapter.
    waiting for your great answer.
    bye.
    regards.
    seeta ram.

    Hello Seeta,
    let me see if I give it using a simple scenario that I implamented : i nedd to transfer a very large file from one server to the other by XI.
    to save space and network traffic I use an OS command before picking up the file to run a zip command to zip the file.
    after I transfer the file to the target server I run another OS command after the transfer to unzip the file.
    now to your second question:
    the before Os command on the target server is used mostly for checks (make sure there isn't a file by that name or backing up existing data)
    and the after sender OS command is usualy for backing up or erasing existing files (cause it is done only after the first part was finished succesfully).
    Uri Lifshitz.
    p.s.
    there was a blog obout this titled "XI as a huge file mover"
    and you can see a description and my scripts at https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/05/03/additionaltipsforusingXIasahugefiletransfer%28withbatchscripts%29&

  • Operating  System commands in FTP adapter

    Hi
    I have a requirement to use "Operating System Command" option in the Sender/Receiver side File Adapter.
    And in help.sap.com they have brief notes on this.
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    When I tried to execute some valid DOS commands like MKDIR,RENAME etc it didn't work at all.
    But process has been sucessfully completed without any error!!!
    System : XI 3.0 SP 11
    Can anyone has any inputs on this ? Pls share me some ideas with example. Is there is any limitations on this feature?
    Note: When I tried to give invalid commands hfjkhfkasdjfh,asdjdhas etc, still it is not giving any error!!. Still my File Adapter as well as entire process is successfully completed.

    Hi,
    A couple of cautionary notes.
    The OS command is executed after the file has been processed, e.g. read successfully by a sender adapter or created successfully by a receiver adapter.
    The file name processed can be accessed using %f in the OS command.
    The OS command must include the full directory path, or XI will assume the current directory which may not be where your command resides.
    Regards,
    Bill

  • Executing Operating system command

    I have a file(ftp)-xi-file(ftp) scenario. I want to run a operating system command on output/processed file which is on a different physical server through a script. But I have seen my script is not working. But when I did the same on the same physical server on which XI is hosted it is working fine. Could you plz somebody advise whether it works ?? if it is the case what precaustions should we take ??
    thanks
    kumar

    Hi Palnati
    OS command will run on XI OS only so you need to use FTP parameter in the script and "permanent connection" as connection mode
    Check this thread also
    Re: FTP ReceiverChannel and OS commands help
    Thanks
    Gaurav

  • External Operating system Commands -GPG

    Hi Experts,
    Im quite new in SAP and we have a task to encrypt a file generated from SAP for upload to bank. We use  the external operating system commands to call the gpg commands for file encryption. But we encounter an error when we execute the command
    below is the error we encounter
    gpg: [Recptient's ID]: skip : public key not found
    gpg: [Filename] : encryption failed : public key not found
    but when I run the command on OS level it execute properly without any problem.
    hope you guys could me an idea on how to fix the issue i encounter
    Thanks in advance!!

    Louie,
    What is the command that you used? which OS?
    Thank you
    Regards

  • How to execute operation system commands by using TSQL without enabling xp_cmdshell.

    Hi Experts
    Looking for advise if one can use operation system commands using TSQL without enabling xp_cmdshell. 
    actually using xp_cmdshell requires sysadmin privs which I am unable to provide (directly or using proc) to a user  but the user needs some operating system commands to execute for file manipulation from sql server session. Please share your thought.
    Best Regards 
    khalil

    >but the user needs some operating system commands to execute for file manipulation from sql server session
    See article here
    http://www.mssqltips.com/sqlservertip/2014/replace-xpcmdshell-command-line-use-with-sql-server-agent/:
    "Problem
    I need to run something from the command-line, but based on best practices xp_cmdshell has been disabled. The task that needs to run is an internal process that will originate from within SQL Server. Is there a way to do this without using xp_cmdshell?
    Solution
    The use of xp_cmdshell is generally frowned upon and is now recommended to be disabled, unless it is absolutely necessary.  There is a solution that works around this restriction via the use of SQL Server Agent.
    Wherever SQL Server is installed, SQL Server Agent is installed with it (except for SQL Express). SQL Server Agent has the ability to run job steps which invoke the command shell. And in the case that the job is owned by a member of the sysadmin fixed server
    role, the job will execute as the service account under which the SQL Server Agent is running. "
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Unzip file using operating system command in file/ftp receiver adapter

    Hi,
    I'm wonderdering how to unzip a zip-file in the receiver file/ftp adapter. I know it is possible to do it using the 'Operating system command' feature, but somehow the command I use seems to be ignored! (I'm using SP14, unix).
    The command I entered is quite simple: unzip %F (also tried the %f, but i guess it doesn't really matter wich on I use).
    Is it possible that I'm unzipping to another directory than the one i expect? the unzip should be performed to/in the current directory, and assumingly current directory is the one stated in the 'Target Directory', right?
    Hope someone can clearify this issue for me.
    Best regards,
    Daniel

    Hi Daniel,
    It seems to me also, that the files are being unzipped to a different location than what you are expecting. The OS command might getting executed in some default location(i am trying to fnd that out)on the server and not in the target directory of the channel(It seems logical to me)....
    If you have time...pls try this out & see whether this would help...
    Have a shell script written with the following commands in them
    cd <path to target directory>
    unzip $1(filename from the channel)
    and in the OS command in the Channel give....
    <absolute path to the .sh file> %F
    Thanks,
    Renjith.

  • Problem with zip operating system command

    Hello,
    i have the following configuration in the file receiver adapter:
    Directory: /tmp/
    File Name Scheme: %name%.txt
    Variable substitution:
    Variable Name: name                 Reference: payload: record,1,name,1
    Run Operating system command:
    /usr/bin/zip /tmp/%f.zip %F
    The execution is succesful, but i have a small problem. The file name is "file.txt.zip", the .txt should appear but i dont know how to skip it, I have tried so many ways but it doesnt work, I should receive a file called "file.zip" With a file inside in txt format...
    Thanks,
    Luis

    Hi Sriram,
    Thanks, but that wouldnt work out, Im using the %f for my file name, so this move command shouldnt work for me, because my filename changes in every execution, so I cant write something like this: mv file.txt.zip file.zip
    The only solution I see would would be a command which deals with strings and that could remove the four last characters of "%f"..but I havent found anything for doing it.
    Regards,
    Luis

  • Operating system command in file adaptor

    Hi,
    I am doing file to Idoc scenario, can i use the Operating system command in file adaptor to compress the file at FTP server and decompress the file at IE. I don’t know is it possible and if yes then how or is there any other way to handle the big files as the network speed is very low.
    Any clues!!!!!!!!!!!
    Thanks in advance
    Regards
    Swatantra

    Have a look into these threads - they seem to have the solution u need (i havnt tried it though)
    Unzip file using operating system command in file/ftp receiver adapter
    How to zip and unzip xml files dynamically by XI

  • Operating system command in file receiver adapter

    Hi,
    How to use the Run Operating system command after message processing option in the parameters tab of the file receiver adapter.
    I am working on a scenario wherein a batch file needs to be invoked after the file is written on the file system.
    So how do i invoke this batch file from the file reciever adapter ( Run Operating system command after message processing ).

    Hi,
    did you see this page?
    http://help.sap.com/saphelp_nwpi71/helpdata/en/44/556cb799c93677e10000000a114a6b/content.htm
    it shows all you need to know
    Regards,
    Michal KRawczyk

  • File Receiver Adapter:Run Operating System COmmand after message Processig:

    Dear All,
    I have gone through this link
    [http://help.sap.com/saphelp_nw2004s/helpdata/EN/e3/94007075cae04f930cc4c034e411e1/content.htm]
    But i have a problem.
    In the scenario which we have, File name is DYNAMICALLY GENERATED by a UDF
    I want to call the file at run time after message processing via Command Line and execute some os commands.
    But since the file name is Dynamic....How will i call the file at run time in Command Line:
    SYNTAX: %f(FileName)
    How will i specify the file name in the above syntax as the file name is Dynamic and not constatnt.
    Please Advice.
    Senthilprakash.

    Dear All,
    Yes just now i got the answer from this thread[OS command line script - Need help;
    Actually i have another doubt now
    In REVEIVER FILE ADAPTER:
    when we give Run Operating system Command After Message processing
    does the OS command get executed after the output file is placed in the Receiver folder/server or before its placed in the receiver folder?
    Regards,
    Senthilprakash.

  • Unable to open the physical file "D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\abc.mdf". Operating system error 2: "2(The system cannot find the file specified.)".

    hi,
    am running the below command for moving sql serevr mdf and ldf files  from one  drive to another : c  drive to d drive:
    but am getting the below error
    SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\abc.mdf". Operating system error 2: "2(The system cannot find the file specified.)".
    use master
    DECLARE @DBName nvarchar(50)
    SET @DBName = 'CMP_143'
    DECLARE @RC int
    EXEC @RC = sp_detach_db @DBName
    DECLARE @NewPath nvarchar(1000)
    --SET @NewPath = 'E:\Data\Microsoft SQL Server\Data\';
    SET @NewPath = 'D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\';
    DECLARE @OldPath nvarchar(1000)
    SET @OldPath = 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\';
    DECLARE @DBFileName nvarchar(100)
    SET @DBFileName = @DBName + '.mdf';
    DECLARE @LogFileName nvarchar(100)
    SET @LogFileName = @DBName + '_log.ldf';
    DECLARE @SRCData nvarchar(1000)
    SET @SRCData = @OldPath + @DBFileName;
    DECLARE @SRCLog nvarchar(1000)
    SET @SRCLog = @OldPath + @LogFileName;
    DECLARE @DESTData nvarchar(1000)
    SET @DESTData = @NewPath + @DBFileName;
    DECLARE @DESTLog nvarchar(1000)
    SET @DESTLog = @NewPath + @LogFileName;
    DECLARE @FILEPATH nvarchar(1000);
    DECLARE @LOGPATH nvarchar(1000);
    SET @FILEPATH = N'xcopy /Y "' + @SRCData + N'" "' + @NewPath + '"';
    SET @LOGPATH = N'xcopy /Y "' + @SRCLog + N'" "' + @NewPath + '"';
    exec xp_cmdshell @FILEPATH;
    exec xp_cmdshell @LOGPATH;
    EXEC @RC = sp_attach_db @DBName, @DESTData, @DESTLog
    go
    can anyone pls help how to set the db offline. currently  i  stopped the sql server services from services.msc and started the  sql server agent.
    should i stop both services for moving from one drive to another?
    note: I tried teh below solution but this didint work:
    ALTER DATABASE <DBName> SET OFFLINE WITH ROLLBACK IMMEDIATE
    Update:
    now am getting the message :
    Msg 15010, Level 16, State 1, Procedure sp_detach_db, Line 40
    The database 'CMP_143' does not exist. Supply a valid database name. To see available databases, use sys.databases.
    (3 row(s) affected)
    (3 row(s) affected)
    Msg 5120, Level 16, State 101, Line 1
    Unable to open the physical file "D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\CMP_143.mdf". Operating system error 2: "2(The system cannot find the file specified.)".

    First you should have checked the database mdf/ldf name and location by using the command
    Use CMP_143
    Go
    Sp_helpfile
    Looks like your database CMP_143 was successfully detached but mdf/ldf location or name was different that is why it did not get copied to target location.
    Database is already detached that’s why db offline failed
    Msg 15010, Level 16, State 1, Procedure sp_detach_db, Line 40
    The database 'CMP_143' does not exist. Supply a valid database name. To see available databases, use sys.databases.
    EXEC @RC = sp_attach_db @DBName, @DESTData, @DESTLog
    Attached step is failing as there is no mdf file
    Msg 5120, Level 16, State 101, Line 1
    Unable to open the physical file "D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\CMP_143.mdf". Operating system error 2: "2(The system cannot find the file specified.)"
    Solution:
    Search for the physical files(mdf/ldf) in the OS and copy to target location and the re-run sp_attach_db with right location and name of mdf/ldf.

Maybe you are looking for

  • Safari Browser won't browse and crashes on IPAD-2

    Hello, I have the latest IOS 8.x installed on my IPAD-2 but haven't been able to get the Safari Browser to work for several months.  When I click Safari, it opens for a few seconds then shuts down...I'm not able to input any web sites. I've tried rem

  • How to build OBJNR of JEST?

    Hi there, hiw can I build the OBJNR (table JEST) based on the field AUFNR manually via string operation? I know that the value is included in table AUFK, but I don't want read this table thousands of times for every entry to detect the OBJNR of table

  • Bridge connection problems

    I am connecting an old aironet 340 to a new Aironet 1300. I can get the association working and aironets talking. The problem is the 340 will not forward on any TCIP data. The association is connected and you can ping from the 1300 to the 340 and bac

  • Scan SKU/UPC Field and Pressing Enter it will convert to Material number.

    Hi Guys, I am trying this report prog wherein I will input the SKU/UPC field from MARA/MEAN table, I will scan this field and convert it to material number then accordingly I will display the output. My question is when user inputs the SKU/UPC field

  • My firefox 3.6.13 now uses 135M and takes ages to load.

    My last upgrade shows a smallish firefox exe file size but Norton has reported a large space usage as reported above and load times have gone out of the window. Chrome load times are very much faster.