Getting the name of files being extracted

Hello all:
I have a script that is extracting files from a zipped file.  I am trying to display the name of the file as it is extracted.  Here is what I have:
foreach($item in $zip.items())
$shell.Namespace("E:\APPs\Folder").CopyHere($item, 0x14)
Write-Host "File: " + $item + " copied"
When I run this, I get the following:
File:  + System.__ComObject +  copied
File:  + System.__ComObject +  copied
File:  + System.__ComObject +  copied
File:  + System.__ComObject +  copied
How do I display the actual name and not type of the file?
Thanks,
jocasio

Hi,
You can use the Name property of the $item object:
foreach($item in $zip.items()) {
Write-Output "Unzipping $($item.Name)"
$shell.Namespace('E:\APPs\Folder').CopyHere($item, 0x14)
Don't retire TechNet! -
(Don't give up yet - 12,830+ strong and growing)

Similar Messages

  • Search a string with in some file and get the name of file

    i want to search a string in some files that are in a given directory and return the name of file having searched string.I am doing this with grep command as given below
    import java.io.*;
    public class linux_java {
    public static void main(String[] args) {
    try {
    String command = "find . | xargs grep -l Resolv /data2/opt/jakarta-tomcat-4.1.24/webapps/Oa/BOG/*.txt";
    final Process process = Runtime.getRuntime().exec(command);
    OutputStream os= process.getOutputStream();
    System.out.println("out put stream= " +os);
    PrintStream stdIn = new PrintStream(new BufferedOutputStream(process.getOutputStream()), true);
    System.out.println("Return code = " + stdIn);
    } catch (Exception e) {
    e.printStackTrace();
    i dont know how to get the name of file that are return by the execution of command through process object. Please send the code for the same

    thanks for your suggestion....
    i change the code but now it is giving error as /usr/bin/find incomplete syntax....but i am giving the right syntax....
    please confirm whether the syntax is correct...
    import java.io.*;
    import java.util.*;
    public class linux_java {
    public static void main(String[] args) {
    try {
    //String command = "ls -alt";
    String command = "find /data2/opt/jakarta-tomcat-4.1.24/webapps/Oa/BOG -type f -exec grep -sl 'Aggarwal' {} \\; 2>/dev/null";
    ///grep -l System test/*java
    System.out.println(" the command is"+command);
    final Process process = Runtime.getRuntime().exec(command);
    InputStream is = process.getErrorStream();
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line="";
    System.out.println(" the BufferedReader is"+br.readLine());
    while ((line = br.readLine()) != null) {
    System.out.println(" the files are"+line);
    } catch (Exception e) {
    e.printStackTrace();
    }

  • How to get the name of file was read from file adapter ?

    Hello!
    I make a pooling into one directory to read all *.fat files in this directory, and I want the name of this file
    is it possible ?
    God bless all!

    it is mentioned in the sample code.. look at the pdf guide inthe sample code document for file adapter.
    you need to define a variable of message type of the file adapter inbound header message type and assign the variable to the apapters tab in the receive activity..
    the variable will have file name now

  • How do I get the name of a file in Xcode in a Cocoa-Applescript application?

    I'm trying ot create an app in Xcode using applescriptObjC. I need to get the names of files, but every time I run the app and trigger the part where the script is supposed to get the name, Xcode gives me an error saying "Can not get name of "/Users/xxxx/xxxx/xxxx.xxx" I have tried everything.
    Any help is appreciated

    can you post some relevant code?

  • 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

  • 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?

  • Need of a Webservice to get the name of the file in a Folder

    Hi All,
    I am in need of a Web service which should get the name of the file in a folder.
    Note :  Folder is created in the MOSS server.
    Thanks.

    Just to add, Mac in intergrated into AD and all I need is help in creating the script
    Thanks

  • Can we get the name of fmx file at runtime

    Hi all,
    can we get the name of fmx file which is doing some DML operation on a specific table Can we back track which fmx module has done DML on a specific table. The reason I need this because I've 7 different fmx files which are doing some DML operation on a specific table and these fmx files were used by different users. Not necessarily 1:1 For eg. one user can do DML through 3 different fmx files. So in such case if I want to want to know from which fmx file this DML has take place .How can I achieve that. I know I can get the oracle username through v$session but it will not suffice my needs. I need the name of fmx file also.
    I'm using:
    Forms [32 Bit] Version 10.1.2.0.2 (Production)
    Oracle Database 10g Release 10.2.0.1.0 - Production
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Any help?
    Warm Regards
    Percy

    Percy,
    For that you can set the Module Field in the V$session in each form by,
    DBMS_APPLICATION_INFO.SET_MODULE(MODULE_NAME => :SYSTEM.CURRENT_FORM, ACTION_NAME => USER);Write this in each form, and then you will get the form name in the V$SESSION's module field with form name.
    Hope this helps.
    Regards,
    Manu.

  • How to get the name of the file parent

    Hi,
    i have a file in this location
    File file = new File(MyFile.doc)
    file.getParent(); returns
    C:\Documents and Settings\Administrator\xyz
    now from the string obtained i just want to get the value "xyz".i.e. i want to get the name of the parent directory.
    how is it possible

    You may use String.indexOf()if(file.getParent().indexOf("/myProject/myPackage") != -1) {
        ...Or you might use regular expressions and Matcher class (or String.matches()) in case of higher complexity.

  • How should we get the out put file-name same as in put file-name in file to

    Hi frnds,
    having hundreds of files in the sender system with different names, how should we get the out put file-name  in the receiver system same as the in put file-name in file to file scenario ?
    Thanks in advance.
    truly,
    snrvakiti.

    Hi,
    In Receiver File Adapter you can set under 'Adapter-Specific Message Properties'
    check Use Adapter-Specific Message Properties
    check Fail on Missing Adapter Message Properties
    Check File Name
    Have a look at this link,  [File_to_File|http://allsapnetweavernotes.blogspot.com/2008/09/how-can-i-access-filename-from-fileftp.html]
    Regards,
    P.Rajesh

  • Get the name of the file generated by the File Adapter

    Hello,
    I am creating XML files using the File Adapter. Each file name is unique (my_file%SEQ%.xml) and I would like to know if there is a way to get the name of the generated file so that I can sent it as an attachment in an email notification. Thanks!

    you can't get the generated filename for write operation.
    But what you can do, is to define header variable of OutboundHeader_msg type, define your own filename (based on your unique creation criteria) and then pass it to invoke activity for file creation.

  • Can I get the name of the jnlp file used to launch my application

    Does anyone know if there is a way to get the name of the jnlp file used to launch the currently executing code?
    Essentially in the code below a way to set myAppFileName without hard coding the string. i.e. code could exist in a utility class used by many jnlp applications.
                String myAppFileName = "myApp.jnlp";
                BasicService bs = (BasicService) ServiceManager.lookup("javax.jnlp.BasicService");
                String url = bs.getCodeBase() + myAppFileName;Seems reasonable that if the jnlp API's know about the codebase that maybe it could hold the file name somewhere too? I hope, I hope ....
    Thanks
    Mike

    Ok. Bravo
    Please mark this as 'Answered' - it will help others on the forum -

  • I name each photo buy replacing the jpeg number with the name. when I burn to disk and open disk the name is not shown. how do I get the name given to show on the burn disk?.

    after I burn the files to dvd and load to view the name does not appear. How do I get the name listed to appear on the burn disk instead of the file number?

    Naming the Photo - or giving it a title - is not the same as naming  file.
    How are you burning to dvd? With iPhoto? If so then the Title will be available in any app that understands basic metadata.
    If you want the title available in the Finder - which does not understand photo metadata  - then you'll need to export the file
    File -> Export
    In the resulting dialogue you'll see a heading for 'File Name'. Choose 'Use Title' from the drop down.
    Regards
    TD

  • How to get the name of the attachment in Sender Mail Adaper?

    hi mates,
    I've scenario a where in I need to pick up a mail with an attachment and change its extension and send it to target system using file adapter.
    I'm able to pick up the mail with attachment using sender mail adapter but not able to get the name of the attachment so that I can use it in mapping or on the adapter configuration. How do I read the name of the attachment and manupulate it?
    I looked at the thread sender mail adapter - attachment name But the solution is not described. I think Stefan is talking about the SP!2 for PI 7.0. I'm on XI 3.0 what is the equivalent SP for that, SP20? Stefan, can you please throw me more light on it?
    I appreciate your valuable inputs
    thx in adv
    praveen

    Thanks Aamir.
    Earlier I replied to that thread asking for more details...but did not see the response...
    anyways, thanks for your quick help..
    but I wonder abt the PI SP12/ XI SP20 pre-requisite. We can have adapter modules on SPs lower than PI SP12/XI SP20 as well, can we not?
    thanks
    praveen

  • How to get the name of tag or variable

    Hi everyone,
    I am a newbie, I have problem on getting the name or tag of the variable from OLE for Processing Control(OPC) server, could anyone tell me how I can get the name of tag or variable from writting vb codes or please direct me to any helpful information. Here are
    my codes,
    Dim ItemsDef(NBR_ITEMS) As String
    Dim DeviceAddress As String
    Dim IndItem As Long
    DeviceAddress = "MBT:152.160.178.60"
    'Preparing the Handles for "AddItems"
    For IndItem = 1 To NBR_ITEMS
    ItemsDef(IndItem) = DeviceAddress & "!40000" & Format(IndItem) '40000 is the memory location of variable in the OPC, how can I get the variable name, what is the code or syntax?
    Next
    blah...
    Thank you,
    Calvin

    Hi Calvin,
    If you are looking for general information and examples about OPC, then we have lots of places for you to browse!
    Here is a small list, and you can probably find other links within these documents:
    **If you have Measurement Studio from National Instruments, then you can look at the "Measurement Studio Reference" help file. Search for OPC and in the overview you will find the methods for accessing the items on an OPC server.
    **Elsewhere in the help file, you can find a link to this Application Note on our developer zone
    http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?​openagent&F4921B34CA8F4A9786256874005BE3F7&cat=7CD​A3E51FEFC4AA2862568B80071A1E2
    **One more resource is http://www.ni.com/opc
    **Probably the most useful will be the examples yo
    u can find on our web site. You can go to http://www.ni.com/support and in Option 3 search the Example Code database for "opc".
    In the first example program (Controlling OPC Servers with the OPC Automation API in Visual Basic) that you should get when searching for "opc" in the example programs database, look for the line with this code: "browser.GetItemID(leaf)". There you can see the way the program creates an OPCBrowser from the server instance, and then gets the servers available items for use by the client. This sounds like the specific information you are looking for with the variable name.
    If you aren't able to find out your answer here or in the various help resources, then please feel free to contact us at National Instruments at http://www.ni.com/ask
    Regards,
    John N
    Applications Engineer
    National Instruments

Maybe you are looking for

  • Few Questions on my Iphone 3G

    Had the iphone 3G for about a week now, and love it, but just got a couple of questions as there is no manual as such. 1. Can iphone 3G downlaod adobe acrobat/pdf reader/word (pages) or numbers) to see attachements? 2. Alot of video content on google

  • Inserting  records in table .

    requirement is like this we have three message text input filelds the fields are finance,MMd,User depts,using lovs we are searching for person id (coming from different tables according some conditions) and return to the input field based on the pers

  • Forms globalization

    Please suggest a nice document for Forms globalization. If anyone implemented globalization, please share the process. Thank you, Prasad

  • Equium L20 strange wireless connection issue- Atheros AG5005G

    I use ConfigFree - the program connects to any available network but the system tool can't (sometimes it does, but only for a while). So it looks I'm connected to the internet, even if that system tools shows I'm not (It's shown in a tray). In a fact

  • Why does Type color change when published?

    I am designing a site that has horizontal main menu and underneath that is a 3 tab panel shown below. Each tab brings up a new panel. The tab in the center is in the "Active state" and the others are in the "Normal state". The Rollover state & the Mo