+ Reply to Thread
Results 1 to 6 of 6

Kill command using &

  1. #1
    PCLIVE
    Guest

    Kill command using &

    The following code works fine.

    Kill FileNameZip2
    Kill FileNameZip3


    Would the following code do the same?

    Kill FileNameZip2 & FileNameZip3

    Thanks,
    Paul



  2. #2
    Ron de Bruin
    Guest

    Re: Kill command using &

    Have you try it ?
    Answer is No

    If you want to delete all files in a folder you can do this

    On Error Resume Next
    Kill "C:\folder\*.*"




    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "PCLIVE" <[email protected]> wrote in message news:[email protected]...
    > The following code works fine.
    >
    > Kill FileNameZip2
    > Kill FileNameZip3
    >
    >
    > Would the following code do the same?
    >
    > Kill FileNameZip2 & FileNameZip3
    >
    > Thanks,
    > Paul
    >




  3. #3
    Charlie
    Guest

    RE: Kill command using &

    No, that would append the two filename strings into one. It would be the
    same as doing

    Kill "C:\File1.txtC:\File2.txt"

    "PCLIVE" wrote:

    > The following code works fine.
    >
    > Kill FileNameZip2
    > Kill FileNameZip3
    >
    >
    > Would the following code do the same?
    >
    > Kill FileNameZip2 & FileNameZip3
    >
    > Thanks,
    > Paul
    >
    >
    >


  4. #4
    PCLIVE
    Guest

    Re: Kill command using &

    Ok Ron,

    Here's what I got. I need to kill one or two files based on an if
    statement. If L2 = "Jan", then I need to delete FileNameZip3. Else I need
    to delete two files, FileNameZip2 and FileNameZip3. How would I do this?
    If there is such thing as a block Else statement...

    If Sheets("Setup").Range("L2").Value = "Jan" _
    Then Kill FileNameZip3 _
    Else Kill FileNameZip2
    Kill FileNameZip3

    Thanks,
    Paul

    "Ron de Bruin" <[email protected]> wrote in message
    news:[email protected]...
    > Have you try it ?
    > Answer is No
    >
    > If you want to delete all files in a folder you can do this
    >
    > On Error Resume Next
    > Kill "C:\folder\*.*"
    >
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "PCLIVE" <[email protected]> wrote in message
    > news:[email protected]...
    >> The following code works fine.
    >>
    >> Kill FileNameZip2
    >> Kill FileNameZip3
    >>
    >>
    >> Would the following code do the same?
    >>
    >> Kill FileNameZip2 & FileNameZip3
    >>
    >> Thanks,
    >> Paul
    >>

    >
    >




  5. #5
    Ron de Bruin
    Guest

    Re: Kill command using &

    Try this

    If Sheets("Setup").Range("L2").Value = "Jan" Then
    Kill FileNameZip3
    Else
    Kill FileNameZip2
    Kill FileNameZip3
    End If


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "PCLIVE" <[email protected]> wrote in message news:%[email protected]...
    > Ok Ron,
    >
    > Here's what I got. I need to kill one or two files based on an if statement. If L2 = "Jan", then I need to delete FileNameZip3.
    > Else I need to delete two files, FileNameZip2 and FileNameZip3. How would I do this? If there is such thing as a block Else
    > statement...
    >
    > If Sheets("Setup").Range("L2").Value = "Jan" _
    > Then Kill FileNameZip3 _
    > Else Kill FileNameZip2
    > Kill FileNameZip3
    >
    > Thanks,
    > Paul
    >
    > "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    >> Have you try it ?
    >> Answer is No
    >>
    >> If you want to delete all files in a folder you can do this
    >>
    >> On Error Resume Next
    >> Kill "C:\folder\*.*"
    >>
    >>
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "PCLIVE" <[email protected]> wrote in message news:[email protected]...
    >>> The following code works fine.
    >>>
    >>> Kill FileNameZip2
    >>> Kill FileNameZip3
    >>>
    >>>
    >>> Would the following code do the same?
    >>>
    >>> Kill FileNameZip2 & FileNameZip3
    >>>
    >>> Thanks,
    >>> Paul
    >>>

    >>
    >>

    >
    >




  6. #6
    PCLIVE
    Guest

    Re: Kill command using &

    That's it. Pretty simple, but my brain wasn't functioning.

    Thanks for the help.
    Paul

    "Ron de Bruin" <[email protected]> wrote in message
    news:%[email protected]...
    > Try this
    >
    > If Sheets("Setup").Range("L2").Value = "Jan" Then
    > Kill FileNameZip3
    > Else
    > Kill FileNameZip2
    > Kill FileNameZip3
    > End If
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "PCLIVE" <[email protected]> wrote in message
    > news:%[email protected]...
    >> Ok Ron,
    >>
    >> Here's what I got. I need to kill one or two files based on an if
    >> statement. If L2 = "Jan", then I need to delete FileNameZip3. Else I
    >> need to delete two files, FileNameZip2 and FileNameZip3. How would I do
    >> this? If there is such thing as a block Else statement...
    >>
    >> If Sheets("Setup").Range("L2").Value = "Jan" _
    >> Then Kill FileNameZip3 _
    >> Else Kill FileNameZip2
    >> Kill FileNameZip3
    >>
    >> Thanks,
    >> Paul
    >>
    >> "Ron de Bruin" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Have you try it ?
    >>> Answer is No
    >>>
    >>> If you want to delete all files in a folder you can do this
    >>>
    >>> On Error Resume Next
    >>> Kill "C:\folder\*.*"
    >>>
    >>>
    >>>
    >>>
    >>> --
    >>> Regards Ron de Bruin
    >>> http://www.rondebruin.nl
    >>>
    >>>
    >>> "PCLIVE" <[email protected]> wrote in message
    >>> news:[email protected]...
    >>>> The following code works fine.
    >>>>
    >>>> Kill FileNameZip2
    >>>> Kill FileNameZip3
    >>>>
    >>>>
    >>>> Would the following code do the same?
    >>>>
    >>>> Kill FileNameZip2 & FileNameZip3
    >>>>
    >>>> Thanks,
    >>>> Paul
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1