Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VBS (WSH) Dateien verscheiben

Empfohlene Antworten

Veröffentlicht

Hallo,

gibts bei dem Befehl Move unter VBS eine Möglichkeit, das er existierende Dateien überschreibt? So wie mit dem MSD-Befehl move /Y möglich ?


set fso = CreateObject("Scripting.FileSystemObject")
...
set f1 = fso.GetFile(filename) 'zu verschiebende Datei
...
ToFolderPath = "C:\Bla\blub\"
1.move(ToFolderPath) ' hier wenn schon vorhanden überschreiben
[/PHP]

Gruß

Ich weiß es nicht, aber falls es nicht gehen sollte:

Prüf doch einfach ob es die Datei am Zeil schon gibt und lösch sie bei bedarf vorher.

Gegenfrage, warum soviel Ballast und dazu noch schlechten (WSH) mitschleppen, wenns auch mit VB Bordmitteln geht?

Die Datei wird doch ersetzt.


Private Sub Form_Load()

     Call VBA.FileCopy(sSource, sDest)

End Sub

Gegenfrage. Hab ich hier VB?

Woher soll ich denn wissen, ob Du VB da hast oder nicht?:confused:

Ich habe Dir eine weitere Möglichkeit aufgezeigt, die ohne zusätzliche Controls/Dlls auskommt.

Zudem musst Du die Datei dann noch löschen, wenn Du sie kopiert hast:


Call VBA.FileCopy(sSource, sDest)

Call VBA.Kill(sSource)

Oh, wer lesen kann ist klar im Vorteil.

FSO's .Move kennt kein überschreiben, du musst vorher ein .Delete einsetzen.

s'Amstel

OK, danke

Gruß

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.