vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
NEU! sevCoolbar 3.0 - Professionelle Toolbars im modernen Design!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Visual-Basic Einsteiger
Re: Dateien kopieren 
Autor: GhostRE
Datum: 03.07.08 13:38

Na, dann doch lieber mit der API

Private Declare Function SHGetSpecialFolderPath Lib "SHELL32.DLL" Alias _
  "SHGetSpecialFolderPathA" (ByVal hWnd As Long, ByVal lpszPath As String, _
  ByVal nFolder As Integer, ByVal fCreate As Boolean) As Boolean
Hier ein paar der gültigen Constanten

    CSIDL_COMMON_ALTSTARTUP = &H1E ' *  - File system directory that 
    ' corresponds to the nonlocalized Startup program group for all users. 
    ' Valid only for Windows NT systems.
    CSIDL_COMMON_APPDATA = &H23 ' *  - Version 5.0. Application data for all 
    ' users. A common path is C:\WINNT\Profiles\All Users\Application Data.
    CSIDL_COMMON_DESKTOPDIRECTORY = &H19 ' *  - File system directory used to 
    ' physically store file objects on the desktop (not to be confused with the 
    ' desktop folder itself). A common path is 
    ' C:\WINNT\Profiles\username\Desktop
    CSIDL_COMMON_DOCUMENTS = &H2E ' *  - File system directory that contains 
    ' documents that are common to all users. A common path is 
    ' C:\WINNT\Profiles\All Users\Documents. Valid only for Windows NT systems.
    CSIDL_COMMON_FAVORITES = &H1F ' *  - File system directory that serves as a 
    ' common repository for all users' favorite items. Valid only for Windows _
    NT systems.
    CSIDL_COMMON_PROGRAMS = &H17 ' *  - File system directory that contains the 
    ' directories for the common program groups that appear on the Start menu 
    ' for all users. A common path is c:\WINNT\Profiles\All Users\Start 
    ' Menu\Programs. Valid only for Windows NT systems.
    CSIDL_COMMON_STARTMENU = &H16 ' *  - File system directory that contains 
    ' the programs and folders that appear on the Start menu for all users. A 
    ' common path is C:\WINNT\Profiles\All Users\Start Menu. Valid only for 
    ' Windows NT systems.
    CSIDL_COMMON_STARTUP = &H18 ' *  - File system directory that contains the 
    ' programs that appear in the Startup folder for all users. A common path 
    ' is C:\WINNT\Profiles\All Users\Start Menu\Programs\Startup. Valid only 
    ' for Windows NT systems.
    CSIDL_COMMON_TEMPLATES = &H2D ' *  - File system directory that contains 
    ' the templates that are available to all users. A common path is 
    ' C:\WINNT\Profiles\All Users\Templates. Valid only for Windows NT systems.
    CSIDL_COOKIES = &H21 ' *  - File system directory that serves as a common 
    ' repository for Internet cookies. A common path is 
    ' C:\WINNT\Profiles\username\Cookies.
    CSIDL_DESKTOPDIRECTORY = &H10 ' *  - File system directory that contains 
    ' files and folders that appear on the desktop for all users. A common path 
    ' is C:\WINNT\Profiles\All Users\Desktop. Valid only for Windows NT systems.
    CSIDL_FAVORITES = &H6 ' *  - File system directory that serves as a common 
    ' repository for the user's favorite items. A common path is _
    C:\WINNT\Profiles\username\Favorites.
    CSIDL_FONTS = &H14 ' *  - Virtual folder containing fonts. A common path is 
    ' C:\WINNT\Fonts.
    CSIDL_HISTORY = &H22 ' *  - File system directory that serves as a common 
    ' repository for Internet history items.
    CSIDL_INTERNET_CACHE = &H20 ' *  - File system directory that serves as a 
    ' common repository for temporary Internet files. A common path is 
    ' C:\WINNT\Profiles\username\Temporary Internet Files.
    CSIDL_LOCAL_APPDATA = &H1C ' *  - Version 5.0. File system directory that 
    ' serves as a data repository for local (non-roaming) applications. A 
    ' common path is C:\WINNT\Profiles\username\Local Settings\Application Data.
    CSIDL_PROGRAMS = &H2 ' *  - File system directory that contains the user's _
      program groups (which are also file system directories). A common path is _
      C:\WINNT\Profiles\username\Start Menu\Programs.
    CSIDL_PROGRAM_FILES = &H26 ' *  - Version 5.0. Program Files folder. A 
    ' common path is C:\Program Files.
    CSIDL_PROGRAM_FILES_COMMON = &H2B ' *  - Version 5.0. A folder for 
    ' components that are shared across applications. A common path is 
    ' C:\Program Files\Common. Valid only for Windows NT and Windows® 2000 
    ' systems.
    CSIDL_PERSONAL = &H5 ' *  - File system directory that serves as a common 
    ' repository for documents. A common path is C:\WINNT\Profiles\username\My 
    ' Documents.
Ich glaube
CSIDL_PERSONAL
wäre die richtige für dich.

Der Aufruf

'Systemordner ermitteln
Public Function GetSpecialFolderA(ByVal lngSpecialFolder As Long) As String
 
Dim Ret As Long
Dim Trash As String
 
   Trash = Space$(260)
 
   Ret = SHGetSpecialFolderPath(0, Trash, lngSpecialFolder , False)
   If Trim$(Trash) <> Chr(0) Then Trash = Left$(Trash, InStr(Trash, Chr(0)) _
     - 1) '& "\"
 
   GetSpecialFolderA = Trash
 
End Function
Wenn du beim Kopieren eine Fortschrittsanzeige haben willst, dann guckst du hier:
http://www.vbarchiv.net/tipps/details.php?id=635

Beitrag wurde zuletzt am 03.07.08 um 13:44:53 editiert.
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Dateien kopieren887Andreas Nagel30.06.08 20:51
Re: Dateien kopieren sory ergänzend dafür542Andreas Nagel30.06.08 20:53
Re: Dateien kopieren595VBMichi01.07.08 11:35
Re: Dateien kopieren500Andreas Nagel03.07.08 13:07
Re: Dateien kopieren586cheezburgla03.07.08 13:26
Re: Dateien kopieren569GhostRE03.07.08 13:38
Re: Dateien kopieren488Andreas Nagel07.07.08 12:36

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel