IMHO.WS

IMHO.WS (http://www.imho.ws/index.php)
-   Операционные системы M$ (http://www.imho.ws/forumdisplay.php?f=2)
-   -   Можно-ли запретить W2k создавать папки заглавными буквами? (http://www.imho.ws/showthread.php?t=34905)

Kirilla 22.07.2003 11:12

Можно-ли запретить W2k создавать папки заглавными буквами?
 
Hello All!!! Народ а можно ли запретить W2K создавать паки большими буквами например (FOLDER), и сменить вид у уже имеющихся на (Folder)....Очень нужно.....:idontnow:

ShooTer 22.07.2003 17:58

Kirilla
  • Standardization helps facilitate system administration. For example, having a standard set of folder names makes it easier to run scripts that verify that the proper set of files has been installed on a computer. With standard folder names, scripts such as these can simply connect to the desired folders without needing a list of unique folder names and locations for each individual computer.

    Scripts can help you implement standardized naming schemes on computers throughout your organization. For example, the Win32_Directory class provides a Rename method that allows you to rename a folder. Thus, you can write a script that connects to all the domain controllers in your organization and renames the folder C:\Stuff to C:\Administrative Scripts.

    To rename a folder, first bind to the folder in question and then call the Rename method. As the sole parameter to the method, pass the new name for the folder as a complete path name. For example, if the folder in the C:\Scripts\Logs\Backup is to be renamed C:\Scripts\Archive, you must pass C:\Scripts\Archive as the complete folder name. Passing only the folder name Archive results in an Invalid path error.

Scripting Steps

Listing contains a script that binds to the folder C:\Scripts and renames the folder C:\Script Repository. To carry out this task, the script must perform the following steps:
  • 1.Create a variable to specify the computer name.
    2.Use a GetObject call to connect to the WMI namespace root\cimv2, and set the impersonation level to "impersonate."
    3.Use the ExecQuery method to query the Win32_Directory class.
    To limit data retrieval to a specified folder, a Where clause is included restricting the returned folders to those with the name C:\\Scripts. You must include both backslashes (\\) in the name.
    4.For the single folder in the returned collection, use the Rename method to rename the folder to C:\Script Repository.
    5.Echo the results of the renaming procedure. A 0 indicates that the folder was successfully renamed.

PHP код:

strComputer "."
Set objWMIService GetObject("winmgmts:" _
    
"{impersonationLevel=impersonate}!\\" strComputer "\root\cimv2")
Set colFolders objWMIService.ExecQuery _
    
("SELECT * FROM Win32_Directory WHERE Name = 'c:\\Scripts'")
For 
Each objFolder in colFolders
    errResults 
objFolder.Rename("C:\Script Repository")
    
Wscript.Echo errResults
Next 


Lotus 23.07.2003 12:20

Стандартизация помогает облегчать администрацию системы. Например, урегулировав стандарт названий папки облегчает управлять подлинниками, которые проверяют, что надлежащий набор файлов был установлен на компьютере. Со стандартными названиями папки, подлинники типа них могут просто соединиться с желательными папками, не нуждаясь в списке уникальных названий папки и местоположений для каждого индивидуального компьютера.

Подлинники могут помочь Вам осуществлять стандартизированные схемы обозначения на компьютерах всюду по вашей организации. Например, Win32_Directory класс обеспечивает Переименовывающийся метод, который позволяет Вам переименовывать папку. Таким образом, Выможете написать подлинник, который соединяется со всеми диспетчерами области в вашей организации и переименовывает папку C:\Stuff к C:\Administrative Подлинникам.

Чтобы переименовывать папку, сначала свяжите с рассматриваемой папкой, и затем назовите Переименовывающийся метод. Как единственный параметр к методу, передайте новое название для папки как полное название дорожки. Например, если папка в C:\Scripts\Logs\Backup должна быть переименована C:\Scripts\Archive, Вы должны передать C:\Scripts\Archive как полное название папки. Передавая только папка называет результаты Архива по Недействительной ошибке дорожки.



Scripting Шаги

Внесение в список содержит подлинник, который связывает с папкой C:\Scripts и переименовывает папку C:\Script Склад. Чтобы выполнять эту задачу, подлинник должен исполнить следующие шаги:



1.Create переменная, чтобы определить компьютерное название.
2.Use запрос GetObject соединяться с WMI namespace root\cimv2, и устанавливать уровень олицетворения, чтобы "явиться олицетворением".
3.Use ExecQuery метод подвергать сомнению Win32_Directory класс.
Ограничивать исправление данных указанной папкой, Где пункт включен, ограничивая возвращенные папки в те с названием C: \\ Подлинники. Вы должны включить обе наклонных черты влево (\\) на название.
4.For единственная папка в возвращенном собрании, используйте Переименовывающийся метод переименовать папку к C:\Script Складу.
5.Echo результаты процедуры переименования. 0 указывает, что папка была успешно переименована.

ShooTer 23.07.2003 12:25

Lotus
Spasibo za perevod...U menya vremeni ne bylo vse pisat' na russkom..:)

Kirilla 23.07.2003 12:55

Спасибо всем :claps: :claps: понял щас буду пробовать....


Часовой пояс GMT +4, время: 20:40.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.