Verschieben nach .. (übergeordneten Ordner) und diesen dann anzeigen

German support forum

Moderators: white, Hacker, Stefan2

Post Reply
Wurzelsepp
Junior Member
Junior Member
Posts: 63
Joined: 2012-12-13, 05:07 UTC

Verschieben nach .. (übergeordneten Ordner) und diesen dann anzeigen

Post by *Wurzelsepp »

Hallo,

gibt es eien Tastenkombination, bzw kann man einen Button machen,der die ausgewählte(n) Datei(en) in den übergeordneten Ordner schiebt und diesen gleich anzeigt?
User avatar
Gerd K
Junior Member
Junior Member
Posts: 70
Joined: 2003-02-11, 07:40 UTC
Location: Europa, Nordfriesland

Re: Verschieben nach .. und anzeigen

Post by *Gerd K »

Meine Lösung ist: Shifttaste drücken und die Datei mit der Maus in den übergeordneten Ordner schieben.
#77116
Wurzelsepp
Junior Member
Junior Member
Posts: 63
Joined: 2012-12-13, 05:07 UTC

Re: Verschieben nach .. und anzeigen

Post by *Wurzelsepp »

herzlichen Dank für den Tipp
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

PowerShell: Verschiebe Dateien ins Vaterverzeichnis und wechele dorthin

Post by *Stefan2 »

Wurzelsepp wrote: 2022-08-03, 07:01 UTC Hallo,

gibt es eien Tastenkombination, bzw kann man einen Button machen,der die ausgewählte(n) Datei(en) in den übergeordneten Ordner schiebt und diesen gleich anzeigt?

Hier ein Powershell-skript dazu.

Speichere es als "Move Files to Parent folder and CD.ps1"
Erstelle damit einen Button oder ein UserDefiniertesKommando, welches man
ebenfalls als Kommando in einem Button-verwenden kann, oder dem man direkt ein Tastaturkürzel zuweisen kann.

Code: Select all

# 2022-08-04 Thu 11:32:16
# Stefan: move selected files and folders to parent folder and next switch TCs view to parent folder 
# Found at https://ghisler.ch/board/viewtopic.php?t=77322
#
# Save this script as plain text file with name "Move Files to Parent folder and CD.ps1"
# 
# - Create a button like (or create a UserDefinedCommand in usercmd.ini and add an keyboard shortcut)
# Command    = PowerShell   (or PowerShell -NoExit)
# Parameters = -File "D:\rive\path to\Move Files to Parent folder and CD.ps1" "%WL"
# Start path = 
# Icon file  = PowerShell 	(or WCMICONS.DLL)
# Tooltip    = PowerShel - Move Files to Parent folder and CD.ps1
# [x] Run minimized 

# =============================================================================
# U S E R   S E T T I N G S 



# =============================================================================
# THE CODE - DON'T TOUCH

# get name of current folder:
 $FolderPath = (get-item '.').FullName
 "DEBUG: current folder is: $FolderPath"
 
# get name of current parent:
 $ParentFolder = (get-item '.').Parent.FullName
 "DEBUG: Parent folder is: $ParentFolder"
 
# get TCs' temp file with the list of selected files
  $TC_TempFile = $args[0] 
 "DEBUG: TCs' temp file: $TC_TempFile"

# for each line in $TC_TempFile move file or folder to parent folder:
 Get-Content $TC_TempFile | ForEach{"DEBUG, move: $_" ; Move-Item $_ $ParentFolder}

# if a file is already existing then it will not be moved
 
# DEBUG:
# Start-Sleep -Seconds 3
 
# switch TCs view to parent folder:
 $TotalCmdExe = $env:COMMANDER_EXE
 & $TotalCmdExe /O /S /L="$ParentFolder"

ä remove folder if empty:
 # Remove-Item $FolderPath 

# use PAUSE for to not close the powershell window:
 # pause


# EXPLANATION: TCs Command line parameters (abstract excerpt):
# /O If Total Commander is already running, activate it and pass the path(s) in the command line to that instance (overrides the settings in the configuration dialog to have multiple windows)
# /N Opens in any case a new Total Commander window (overrides the settings in the configuration dialog to allow only one copy of Total Commander at a time)
# /L= Set path in left window
# /R= Set path right window
# /S Interprets the passed dirs as source/target instead of left/right (for usage with /O). For example, a dir passed with /R= will be interpreted as the target dir.

# totalcmd.exe /O /L=c:\ /R="d:\doc" 
# # # Activate already running Total Commander and set the left path to c:\, and the right path to d:\doc
# totalcmd.exe /O /S /R=c:\somepath
# # # Open c:\somepath in the current TARGET panel of the running program. 
# # # Explanation: /S causes Total Commander to read /L as source and /R as target directory instead of left and right.
 


Für weitere Detailfragen siehe auch den Link hier unten

 
Post Reply