nobbi49

Per Batch Konfliktdateien in Dropbox suchen

Wie im Titel beschrieben suche ich eine Möglichkeit Per Batch Konfliktdateien in Dropbox zu suchen.

Ich muss in einem Ordner mit seinen Unterordnern den im Dateinamen vorkommenden Begriff "in Konflikt stehende Kopie" suchen.
Falls so eine Datei gefunden wird muss der Start einer Anwendung mit einem Hinweis gestoppt werden.

Da diese Batch auf verschiedenen Rechnern mit unterschiedlichen Installationen läuft währe es gut wenn die Dropbox als Variable definiert währe.

Ich freue mich auf Eure Lösung
Auf Facebook teilen
Auf X (Twitter) teilen
Auf Reddit teilen
Auf Linkedin teilen

Content-ID: 311305

Url: https://administrator.de/forum/per-batch-konfliktdateien-in-dropbox-suchen-311305.html

Ausgedruckt am: 21.05.2025 um 22:05 Uhr

129813
129813 30.07.2016 aktualisiert um 13:48:29 Uhr
Goto Top
Hi,
try this
@echo off & setlocal
:: get path of dropbox folder from config file
for /f "tokens=1,* delims=: " %%a in ('findstr /ic:"path" "%APPDATA%\Dropbox\info.json"') do set "DROPBOXPATH=%%~b"  
:: find files in all folders
for /f "delims=" %%a in ('dir /b /s /a-d "%DROPBOXPATH%\*in Konflikt stehende Kopie*") do (  
   echo Found the following conflict file: '%%a'  
   set found=true
)
if "%found%" == "true" (  
     echo Cannot start application, because of conflicts!
     pause
     exit
) else (
     echo Starting application ...
     start "" "c:\Path\to\prog.exe"  
)
Regards

EDIT: did some corrections
rubberman
rubberman 30.07.2016 um 13:11:06 Uhr
Goto Top
@129813

A small flaw in line 15 is left. If the first parameter is enclosed into quotation marks it will be interpreted as window title. Should have been someting like ...
start "" "c:\Path\to\prog.exe"

Regards
rubberman
nobbi49
nobbi49 30.07.2016 aktualisiert um 13:45:39 Uhr
Goto Top
Hallo highload
ich habe abgewandelt und bekomme die Meldung:
Die Datei "' dir /b /s /a-d "\HwDaten\*in Konflikt stehende Kopie*.*"" kann nicht gefunden werden
Starting application

Im Ordner HwDaten liegt eine Datei mit Namen AZK_016 (Norberts in Konflikt stehende Kopie 2016-05-18).xlsm

Kannst du da weiterhelfen?

@echo off & setlocal
:: get path of dropbox folder from config file

for /f "tokens=1,* delims=: " %%a in ('findstr /ic:"Path:" "D:\Dropbox\HwDaten\*in Konflikt stehende Kopie*.*"') do set "DROPBOXPATH=%%~b"  
:: find files in all folders
for /f "delims=" %%a in ('dir /b /s /a-d "%DROPBOXPATH%\HwDaten\*in Konflikt stehende Kopie*.*") do (  
   echo Found the following conflict file: '%%a'  
   set found=true
)
if "%found%" == "true" (  
     echo Cannot start application, because of conflicts!
     pause
     exit
) else (
     echo Starting application ...
   ::  start "c:\Path\to\prog.exe" 
     pause

)
129813
129813 30.07.2016 aktualisiert um 13:47:53 Uhr
Goto Top
No, don't replace the paths with your own !! Only customize the path for your app. The Dropbox path is automatically determined from the config file in the Appdata folder. I wrote a comment above it face-confused, sir.