How to recover a lost vs code project

Hope Sain 0 Reputation points
2023-05-18T20:42:17.97+00:00

vs code just automatically update itself and i cannot find my project. the problem is that i cannot remember the path. i have tried searching in the recent files files at vs code but i cannot find it......

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,625 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Filipe Borges 85 Reputation points
    2023-05-19T00:15:32.97+00:00

    Hello Hope Sain,
    I am assuming that your vscode project is still on your computer, that it is in some directory that you remember part of the name of and that it is on some drive on your computer

    Then the powershell script below can help you find the directory you need

    Write the script below on some editor (like vscode), then save it with .ps1 extension

    remember to change "dir_name_path" with part of the name of project name that you remember and "C:" with the driver you want to search

    $searchTerm = "dir_name_path" # Replace with the part of the directory name you want to search
    $directoryBase = "C:" # Replace with the drive you want to search
    
    $foundDirectories = Get-ChildItem -Path $directoryBase -Recurse -Directory | Where-Object { $_.Name -like "*$searchTerm*" }
    
    if ($foundDirectories.Count -gt 0) {
        foreach ($directory in $foundDirectories) {
            Write-Host "directory found: $($directory.FullName)"
        }
    } else {
        Write-Host "No directory found with the name '$searchTerm'."
    }
    

    Then execute the ps file on your terminal. This may take a while

    Best regards


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.