Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5937057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:29:09+00:00 2026-05-22T15:29:09+00:00

My required commandline is as follow: sortfolder.exe -6.70_Extensions -7 where 7 is in foreach(var

  • 0

My required commandline is as follow:

sortfolder.exe -6.70_Extensions -7

where 7 is in foreach(var file in files.OrderByDescending(x=>x).Skip(7))

and -6.70_Extensions is in var di = new DirectoryInfo("C:\\Work\\6.70_Extensions\\Build"); and static string path = "C:\\Work\\6.70_Extensions\\Build\\"

sortfolder.exe:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace sortfolder
{
    class Program
    {
        static string path = "C:\\Work\\6.70_Extensions\\Build\\";

        static void Main(string[] args)
        {
            var di = new DirectoryInfo("C:\\Work\\6.70_Extensions\\Build");

            foreach (var file in di.GetFiles("*", SearchOption.AllDirectories))
                file.Attributes &= ~FileAttributes.ReadOnly;

            var files = Directory.GetDirectories(path, "SASE Lab Tools.*");
            foreach(var file in files)
            Console.WriteLine(file);
            foreach(var file in files.OrderByDescending(x=>x).Skip(7))
            Console.WriteLine(file);
            foreach(var file in files.OrderByDescending(x=>x).Skip(7))
            Directory.Delete(file, true);
        }
    }
}

so my commandline is something of the form of:
sortfolder.exe -version -integer

and this version could be of any form:

6.70_Extensions
6.80_Extensions
7.00_Main
7.20_Main
8.00_Extensions
etc

and integer

can be any integer

how can i achieve this?

EDIT:

after browsing through this

i edited my code:

namespace sortfolder
{
    class Program
    {
        static void Main(string[] args)
        {
            var di = new DirectoryInfo("C:\\Work\\{0}\\Build", args[0]);
            string path = ("C:\\Work\\{0}\\Build\\", args[0]) ;
            foreach (var file in di.GetFiles("*", SearchOption.AllDirectories))
                file.Attributes &= ~FileAttributes.ReadOnly;

            var files = Directory.GetDirectories(path, "SASE Lab Tools.*");
            foreach(var file in files)
            Console.WriteLine(file);
            foreach(var file in files.OrderByDescending(x=>x).Skip({0}), args[1])
            Console.WriteLine(file);
            foreach(var file in files.OrderByDescending(x=>x).Skip({0}), args[1])
            Directory.Delete(file, true);
        }
    }
}

something is not right in my syntax??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:29:09+00:00Added an answer on May 22, 2026 at 3:29 pm

    See the string[] args in Main()? Make use of it.

    http://msdn.microsoft.com/en-us/library/acy3edy3.aspx

    The above link has all the explanations and examples to get you going.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm required to write documentation for my current project that lists all .c files
Required is the true language version of the OS, not the user interface language
If so what are required configuration elements to enable UTF-8 for tiles? I'm finding
Since the only operations required for a container to be used in a stack
I am required to display a two dimensional numpy.array of int16 at 20fps or
What VBA code is required to perform an HTTP POST from an Excel spreadsheet?
I'm required to provide a handover to our content editors for the update corporate
One of the companies required from its prospective employee to give the number of
Firstly, I'm pretty new to C++. I believe that getline() isn't a standard C
I'm trying to convert a flat file into an Excel-readable format. We receive the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.