%userprofile% в Win 98

dam555

В Win 2k системах определена переменная %userpofile%, в которой записан путь к профилю пользователя. В Win 98 ничего подобного нет . Как можно получить полный путь к профилю в Win 98?

maggi14

a v Win9x sistemax byli profili?

dam555

Если захотеть в Win 98 можно сделать многопльзовательский режим и логинится из-под разных людей. Под них создается отдельная директория. Естественно о профилях в нормальном понимании как в Win 2k тут и речи быть не может.
Хочется в ярлыке для некоторой программы прописать рабочую директорию и в зависимости от того, кто залогинился, чтобы пользовательские данные сохранялись для каждого в отдельной директории. В win 2k это делается просто - в ярлыке запуска указывается путь %userpofile%, а в win 98 подобные вещи не работают .

dimabel

C профилями пользователей связана целая группа переменных, начиная от %UserProfile% и %APPDATA%, заканчивая %HOMEDRIVE%, %HOMEPATH%, впрочем, назначиния последних двух я не очень понимаю.

vall

проблема в том что есть они только в NT. в win98 их нет.

dam555

C профилями пользователей связана целая группа переменных, начиная от %UserProfile% и %APPDATA%, заканчивая %HOMEDRIVE%, %HOMEPATH%
Все это верно для Win 2k, а под Win 98 ни одна из этих переменных не определена.

artimon

А что даёт команда SET?

artimon

C:\Windows\Application Data\
или
C:\Windows\Profiles\{Log-in Name}\Application Data\
в зависимости от того, создавались ли на компьютере профили.
Вроде так.

dam555

А что даёт команда SET?
Сейчас не скажу. Несколько переменных таких как %path% и др, не имеющих отношение к делу.
C:\Windows\Application Data\
или
C:\Windows\Profiles\{Log-in Name}\Application Data\
в зависимости от того, создавались ли на компьютере профили.
Это действительно так, но тогда нужно как-то получить Login.
Может быть можно как-то через реестр получить необходимые данные?

Dasar

есть функция
BOOL SHGetSpecialFolderPath( HWND hwndOwner,
LPTSTR lpszPath,
int nFolder,
BOOL fCreate
);
доступная на
Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0
есть функция
HRESULT SHGetSpecialFolderLocation( HWND hwndOwner,
int nFolder,
LPITEMIDLIST *ppidl
);
доступная на
Windows NT 4.0, Windows 95
функция умеет возвращать в зависимости от системы
CSIDL_FLAG_CREATE (0x8000)
Version 5.0. Combine this CSIDL with any of the following CSIDLs to force the creation of the associated folder.
CSIDL_ADMINTOOLS (0x0030)
Version 5.0. The file system directory that is used to store administrative tools for an individual user. The Microsoft Management Console (MMC) will save customized consoles to this directory, and it will roam with the user.
CSIDL_ALTSTARTUP (0x001d)
The file system directory that corresponds to the user's nonlocalized Startup program group.
CSIDL_APPDATA (0x001a)
Version 4.71. The file system directory that serves as a common repository for application-specific data. A typical path is C:\Documents and Settings\username\Application Data. This CSIDL is supported by the redistributable Shfolder.dll for systems that do not have the Microsoft Internet Explorer 4.0 integrated Shell installed.
CSIDL_BITBUCKET (0x000a)
The virtual folder containing the objects in the user's Recycle Bin.
CSIDL_CDBURN_AREA (0x003b)
Version 6.0. The file system directory acting as a staging area for files waiting to be written to CD. A typical path is C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\CD Burning.
CSIDL_COMMON_ADMINTOOLS (0x002f)
Version 5.0. The file system directory containing administrative tools for all users of the computer.
CSIDL_COMMON_ALTSTARTUP (0x001e)
The file system directory that corresponds to the nonlocalized Startup program group for all users. Valid only for Microsoft Windows NT systems.
CSIDL_COMMON_APPDATA (0x0023)
Version 5.0. The file system directory containing application data for all users. A typical path is C:\Documents and Settings\All Users\Application Data.
CSIDL_COMMON_DESKTOPDIRECTORY (0x0019)
The file system directory that contains files and folders that appear on the desktop for all users. A typical path is C:\Documents and Settings\All Users\Desktop. Valid only for Windows NT systems.
CSIDL_COMMON_DOCUMENTS (0x002e)
The file system directory that contains documents that are common to all users. A typical paths is C:\Documents and Settings\All Users\Documents. Valid for Windows NT systems and Microsoft Windows 95 and Windows 98 systems with Shfolder.dll installed.
CSIDL_COMMON_FAVORITES (0x001f)
The file system directory that serves as a common repository for favorite items common to all users. Valid only for Windows NT systems.
CSIDL_COMMON_MUSIC (0x0035)
Version 6.0. The file system directory that serves as a repository for music files common to all users. A typical path is C:\Documents and Settings\All Users\Documents\My Music.
CSIDL_COMMON_PICTURES (0x0036)
Version 6.0. The file system directory that serves as a repository for image files common to all users. A typical path is C:\Documents and Settings\All Users\Documents\My Pictures.
CSIDL_COMMON_PROGRAMS (0x0017)
The file system directory that contains the directories for the common program groups that appear on the Start menu for all users. A typical path is C:\Documents and Settings\All Users\Start Menu\Programs. Valid only for Windows NT systems.
CSIDL_COMMON_STARTMENU (0x0016)
The file system directory that contains the programs and folders that appear on the Start menu for all users. A typical path is C:\Documents and Settings\All Users\Start Menu. Valid only for Windows NT systems.
CSIDL_COMMON_STARTUP (0x0018)
The file system directory that contains the programs that appear in the Startup folder for all users. A typical path is C:\Documents and Settings\All Users\Start Menu\Programs\Startup. Valid only for Windows NT systems.
CSIDL_COMMON_TEMPLATES (0x002d)
The file system directory that contains the templates that are available to all users. A typical path is C:\Documents and Settings\All Users\Templates. Valid only for Windows NT systems.
CSIDL_COMMON_VIDEO (0x0037)
Version 6.0. The file system directory that serves as a repository for video files common to all users. A typical path is C:\Documents and Settings\All Users\Documents\My Videos.
CSIDL_CONTROLS (0x0003)
The virtual folder containing icons for the Control Panel applications.
CSIDL_COOKIES (0x0021)
The file system directory that serves as a common repository for Internet cookies. A typical path is C:\Documents and Settings\username\Cookies.
CSIDL_DESKTOP (0x0000)
The virtual folder representing the Windows desktop, the root of the namespace.
CSIDL_DESKTOPDIRECTORY (0x0010)
The file system directory used to physically store file objects on the desktop (not to be confused with the desktop folder itself). A typical path is C:\Documents and Settings\username\Desktop.
CSIDL_DRIVES (0x0011)
The virtual folder representing My Computer, containing everything on the local computer: storage devices, printers, and Control Panel. The folder may also contain mapped network drives.
CSIDL_FAVORITES (0x0006)
The file system directory that serves as a common repository for the user's favorite items. A typical path is C:\Documents and Settings\username\Favorites.
CSIDL_FONTS (0x0014)
A virtual folder containing fonts. A typical path is C:\Windows\Fonts.
CSIDL_HISTORY (0x0022)
The file system directory that serves as a common repository for Internet history items.
CSIDL_INTERNET (0x0001)
A virtual folder representing the Internet.
CSIDL_INTERNET_CACHE (0x0020)
Version 4.72. The file system directory that serves as a common repository for temporary Internet files. A typical path is C:\Documents and Settings\username\Local Settings\Temporary Internet Files.
CSIDL_LOCAL_APPDATA (0x001c)
Version 5.0. The file system directory that serves as a data repository for local (nonroaming) applications. A typical path is C:\Documents and Settings\username\Local Settings\Application Data.
CSIDL_MYDOCUMENTS (0x000c)
Version 6.0. The virtual folder representing the My Documents desktop item.
CSIDL_MYMUSIC (0x000d)
The file system directory that serves as a common repository for music files. A typical path is C:\Documents and Settings\User\My Documents\My Music.
CSIDL_MYPICTURES (0x0027)
Version 5.0. The file system directory that serves as a common repository for image files. A typical path is C:\Documents and Settings\username\My Documents\My Pictures.
CSIDL_MYVIDEO (0x000e)
Version 6.0. The file system directory that serves as a common repository for video files. A typical path is C:\Documents and Settings\username\My Documents\My Videos.
CSIDL_NETHOOD (0x0013)
A file system directory containing the link objects that may exist in the My Network Places virtu

Dasar

эту же информацию можно получить через WSH:

var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SpecialFolders(bla-bla);

где bla-bla (но не все из них есть на win95):

AllUsersDesktop
AllUsersStartMenu
AllUsersPrograms
AllUsersStartup
Desktop
Favorites
Fonts
MyDocuments
NetHood
PrintHood
Programs
Recent
SendTo
StartMenu
Startup
Templates

dam555

Спасибо, на днях попробую
Оставить комментарий
Имя или ник:
Комментарий: