Entry to open windows explorer instance in specified location

Entry to open windows explorer instance in specified location

avatar

We store documents in folders that match our group names in RDM.

I created this script to add an entry under each group that I could click to automatically open an instance of explorer in the correct folder on our network drive.



cls;
Write-Host;
Write-Host "Creating Open Client Folder entries"
Write-Host;
$sessions = Get-RDMSession | where {($_.ConnectionType -eq "Group") -and ($_.Name -eq $_.Group)}
foreach ($session in $sessions)
{
Write-Host ("Creating: " + $session.Name);
$newentry = New-RDMSession -Group $session.Name -Name 'Open Client Directory' -ConnectionType 'CommandLine'
$newentry.CommandLine = 'C:\Windows\Explorer.exe /e,/separate,\server\sharename\$COMPANY_NAME$'
$newentry.Cmd.EmbeddedWaitTime = 0
$newentry.Cmd.UseDefaultWorkingDirectory = 'false'
$newentry.SortPriority = 1
$newentry.ImageName = 'SampleFolderBlue'
Set-RDMSession $newentry -refresh
}

All Comments (1)

avatar

Hello Paul,

Thank you very much for sharing your script on our forum, much appreciated.

Best regards,

Jeff Dagenais