попробую, Спасибо
Добавлено: Ребята, я вот что нашел, но это работает полностью, если есть админовские права в Винде.
Помогите дописать полностью рабочий вариант этой идеи
Есть предложение. К примеру:
У каждого пользователя на своем рабочем компе есть папка с файлами (которые мы так или иначе скопируем туда). Называется например - С:\Scan_del
Туда помещаем:
1. CMD файл - delfiles.cmd (скрипт привожу ниже)
2. runasp_setup.exe - "RunAs Professional Description" - альтернатива стандартному RunAs, но с возможностью ввода имени и пароля - сразу (так как стандартный RunAs позволяет только автоматом вводить - имя)
3. и скрипт например - RunDelF.cmd - который будет запускаться либо через Logon, либо другим путем - на ваше усмотрение. Что он будет собой представлять - ВОТ ТУТ НУЖНА ВАША ПОМОШЬ ГОСПОДА !!! не откажите
при запуске его (RunDelF.cmd)
1. Происходит установка RunAs Professional
2. окончание установки RunAs Professional
3. запуск delfiles.cmd под Логином и паролем админа используя уже RunAs Professional
и все !!!
ВОТ ПРИМЕР РАБОЧЕГО СКРИПТА (УДАЛЕНИЯ ФАЙЛОВ ПО МАСКЕ в просмотренных всех папках)
::====delfiles.cmd=====
:: @echo off
setlocal ENABLEDELAYEDEXPANSION
:: Корневая папка
set folder=C:\Documents and Settings\%username%
::Расширения файлов, которые нужно удалить
:
список через запятую)
set extensions=.tmp,.bak,.tbk,.err,.gpr
Echo Following extensions will be deleted: %extensions%
Echo in folder %folder% and subfolders of %folder%
Echo.
pause
:: Удаляем файлы по маске в корневой директории
for %%k in (%extensions%) do (echo Deleting files *%%k in folder %folder%)&(del /q /f "%folder%"\*%%k)
:: Удаляем файлы по маске в поддиректориях
for /f "delims=" %%i in ('dir /b /s /l /ad %folder%') do (
pause
for %%k in (%extensions%) do (echo Deleting files *%%k in folder %%i)&(del /q /f "%%i"\*%%k)
)
--------------------------------------------------------------
А вот описание RunAsP.exe
Step by Step
Installexample
Copy the file RunAsP.exe to the system folder.
Register the ".Rap" - files with typing "runasp / register" at the command prompt.
(This step will be also processed when you start RunAsP without parameters.)
The user which starts this operation needs to have rights to access the registry on HKLM!!!
Start RunAsP
A dialog window appears.
Domain:
The logon domain can be the network domain or just the computer name.
You are able to use environment variables (i.e. %computername% or %userdomain%)
User:
Input the username.
You can use environment variables, too.
Password:
Password
Program to run:
Define the path to the application that you want to run with the new user privileges.
Logon with profile:
If this box is checked RunASP will logon to the system with the profile.
This option is only necessary when an access to the user's profile is needed.
Now click on the run - button to check the login procedure
All settings can be saved encrypted (> 128 Bit) to a file.
Use the button "Save .Rap - File". If you don't specify a password RunAsP will ask you later during the start of the .Rap - files.
Now exit the program.
With a double - click on the .Rap - file a login procedure starts.
The in the .Rap - file specified application starts with the assigned user rights.
For every step you do in the application you have this special rights. If you close the started application this rights will get lost.
You can start a .Rap - file with a double - click or optionally via the command line.
Command: RunAsp c:yourfilename.rap
This option is helpful if you would like to use RunAsP in Scripts etc.
Some RunAs Professional usage samples
RunASP is a powerful application. It would take a lot of time to write down the various purposes of this tool. That is why only the main aspects are mentioned following.
You use a program that needs special user rights and you won't assign this rights to your users?
With RunASP you are able to create a .Rap - file with the path to a application which you are able to start with different login informations.
The user only needs to click on the .Rap - file and the application will be started with the new user rights. This is all possible without login off from the system. When you close RunASP the new user rights will get lost.
Outside the application the user possesses his regular rights. This rights won't
be affected.
Your helpdesk team must have access to Client PC's (i.e. via remote connection with
PC Anywhere or VNC)? To modify system settings on the remote machine easily you are
able to create a folder with prepared .Rap - files. The helpdesk team has now the
ability to start every application which is needed without having a lot of work.
RunAsP can be used to install applications in the silent mode (mostly setup.exe /silent)
with administrative rights.
Remark!!!
With both RunAS and RunASP you don't have the chance to open a new explorer window
directly.
Use instead the simple command:
c:program filesInternet Exploreriexplore.exe /c:
The internet explorer will start and open the default path c:.
By changing one level in the upper direction you get full access to the work place.