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

This is a follow-up question from Antlr superfluous Predicate required? where I stated my
required( dependency-expression ) They give an example of required: #other:checked but I want my
Advice required on architecting module I have a PORT Listener that listens to a
Code required to append list (anotherList) to item (id -= l1) of second list
I am required to write a C++ application to run on an embedded Linux
We use @Constraint.Required to validate the fields of our forms, and this generates a
// No overrides required .. let CLR take care of equal and hashcode. Class
What is the NSFormat required for a string like this? Fri, 15 Jun 2012
I am required to count all the instances of quotes in the system based
i have given required permission : <uses-permission android:name=android.permission.WRITE_EXTERNAL_STORAGE /> hard-coded the path as /sdcard/filename

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.