I have been using Perforce for over 4 years now. The one task I find myself having to do infrequently enough that I forget it is adding an entire directory tree of files at once. There is no easy way to do this in P4Win. And P4V just doesn’t perform and doesn’t look right. In Windows, open up a command prompt and type in:

dir /b /s /a-d | p4 -x - add

Now why can’t I remember that?

About the Author:

Learned something? Great! Need help on your development project? I can help @ Brilliant Chemistry or get in touch direct:

  • Ruby on Rails
  • iOS Development
  • System Architecture & Performance

Get in touch:


  1. Anonymous says:

    The way I do this is to drag the folder from Windows Explorer to the changelist pane in p4win.

    • Gopi says:

      I was searching for an option to do this in command prompt from Linux. But not able to find till now.

      More easier way to do in Windows.
      1) Go to the folder which you wanna add in Windows explorer.
      2) Right click on the folder.
      3) Perforce -> Add to Source Control
      4) Once the files are added, you will get a message like “20 files added”.
      5) Go to perforce and submit your default changelist.

    • mike says:

      Keep in mind that for this to work you have to make sure you have the P4 Explorer plugin installed. This isn’t base P4 or P4Win functionality.

      However, I have since switched to P4V and am now using the most beautiful feature -> Reconcile Offline Work… This will compare your local filesystem with the remote depot and provide a convenient view to easily add everything not in the depot. Niiice!

      Command like a king, work like a slave, create like a god.

Leave a Comment