How to run a script as administrator and copy some setting of the connected user's profile?
I want to copy some profile setting to the connected on folder (% userprofile%\AppData\Roaming\Microsoft\Word) user profile password when they connect. Because the standard user accounts do not have the right admin to copy files to the folder, so I use schedule a task to run the .cmd as local administrator every time that a user login. But, when I use the % username % setting to try copying the file to the logged on user profile, the setting of % username % is interpreted as the name of the local administrator because the scheduled task is run as administrator. Therefore, the file is exemplary in the local Administrator profile. All solutions? Thank you
I log on as a user account standard and do a right-click the .cmd and run as admin. The script interpreter .cmd parameter of % username % as the admin because I ran as administrator.
-> Not altogether. There are two cases:
- You are connected under an administrator account. When you right click on cmd.exe, then you get a 'high' console session that is still running under the name of your current account.
- You are connected under a regular account. When you right click on cmd.exe and then you get a prompt and admin account name and its password. The new session is running under admin account.
Is there a way to set the parameter to % username % as long as the logged on user, when you run the .cmd as an administrator.
-> No - see above. Execution of a session high under a regular user account would defy the principle of administrator accounts.
Either of these two options, I gave you in my previous answer might work, with a bit of scripting. A much simpler method would be to restore the default permissions to the %userprofile%\AppData\Roaming\Microsoft\Word folder. Normally full, users have access to it. This is my preferred option. With the help of a scheduled task that is running under an administrator account is a kludge.
Tags: Windows
Similar Questions
-
How to run a script in environment unix and how to run this program into a toad
Hello guys
Please help me!
How to run a script in the unix environment (Group of programs (cursor, programs...) stored in a file file.sql).
file.sql luks like this
WHENEVER OSERROR EXIT FAILURE
WHENEVER SQLERROR EXIT SQL. SQLCODE
SET the position
SET serveroutput size 1000000
coil ins2aais_jobs;
SELECT "FILE IS: ins2aais_jobs' FROM dual;"
SELECT "STARTED:' began, to_char (sysdate," YY/MM/DD HH24:MI:SS) TIME FROM dual; "
DECLARE
lv_upd_ct number: = 0;
lv_ins_ct number: = 0;
lv_exp_ct number: = 0;
---------------------
date of lv_FROM_date;
date of lv_to_date;
lv_mon_or_week varchar2 (20);
date of lv_week_end_date;
lv_month_indicator varchar2 (8);
-------------------------------------------------
Aais CURSOR IS
SELECT the ID substr (ID, 1, 7), SSN, FNAME, LNAME
, SUCCESS, COMPENSATE, INSTALLATION
, MODU, DRIVE, REVERSE, SUCC_RATE
TRANS_TOTAL, FILE_NAME, WEEK_END_DATE
RUN_DATE
OF weekly_aais;
-------------------------
I aais % rowtype;
-------------------------
PROCEDURE p_ins (r1 aais % ROWTYPE) IS
BEGIN
BEGIN
INSERT INTO AAIS_JOBS
(ID, SSN, SUCCESS, COMPENSATE, INSTALL, MODU
, DRIVE, REVERSE, SUCC_RATE, TRANS_TOTAL
FILE_NAME, WEEK_END_DATE, RUN_DATE
AAIS_FNAME, AAIS_LNAME
)
VALUES
(r1.ID, r1. SSN, r1. SUCCESS, r1. COMPENSATE, r1. INSTALLATION, r1. MODU
r1. DISK, r1. CONVERSELY, r1. SUCC_RATE, r1. TRANS_TOTAL
r1. File_name, r1. WEEK_END_DATE, r1. RUN_DATE
r1. FNAME, r1. LNAME
);
lv_ins_ct: = lv_ins_ct + 1;
EXCEPTION
WHILE OTHERS then
DBMS_OUTPUT. PUT_LINE ('ERROR IN THE INSERT STATEMENT');
DBMS_OUTPUT. Put_line (SQLERRM);
lv_exp_ct: = lv_exp_ct + 1;
END;
END;
------------------------------
PROCEDURE p_disp_msg IS
BEGIN
DBMS_OUTPUT. Put_line (' number of insertion: ' | to_char (lv_ins_ct));
DBMS_OUTPUT. Put_line (' number of Exceptions: ' | to_char (lv_exp_ct));
lv_ins_ct: = 0;
lv_exp_ct: = 0;
END;
---------------------------
BEGIN
lv_FROM_date: = to_date ('& 1', 'DD-MON-RR');
lv_to_date: = to_date ('& 2', 'DD-MON-RR');
lv_mon_or_week: = 'and 3';
lv_month_indicator: = di.get_month_ind (lv_mon_or_week, lv_FROM_date, lv_to_date);
------------------------------------
REMOVE FROM AAIS_JOBS
WHERE WEEK_END_DATE = lv_to_date;
-------------------------------------
COMMIT;
Aais OPEN;
LOOP
EXTRACT the aais IN i;
OUTPUT WHEN aais % NOTFOUND;
BEGIN
p_ins (i);
END;
END LOOP;
Aais CLOSE;
commit;
DBMS_OUTPUT. PUT_LINE ('INSERT INTO TABLE JOBS AAIS');
p_disp_msg;
-----------------------------------
END;
/
SELECT "FINISHED: ' | '. TO_CHAR (sysdate, "MM/DD/YY HH24:MI:SS'") FROM dual
/
spool off
"exit";
and also how we organize this into a toad?
Thank you.Hello
You vous connecter connect to oracle through unix and SQL prompt, run these commands in a .sql file.
Toad, you can run the instructions individually by selecting the sql statements or in a set with the F5 key.
Kind regards
AJR -
How do I know how is Administrator and where should I put the password to?
My computer keeps asking for a password
I have 3 standard users on my computer & no one is assigned to be administrator
Cannot install updates because do not know or do not have a password
How do I know how is Administrator and where should I put the password to?Hello
The manual installation of the operating system on the Microsoft Update Web site updates requires the Office of the operating system to run with administrative rights.
Please follow the steps mentioned below.
a. click the Start button.
(b) in the search box of start, type user accounts and click on user account.
c. click on Manage.
d. check which account is designated as administrator account.
Also check out the links below.
Why use a standard account instead of an administrator account?
What is an administrator account?
http://Windows.Microsoft.com/en-us/Windows-Vista/what-is-an-administrator-account
Change the type of user account
http://Windows.Microsoft.com/en-us/Windows-Vista/change-a-users-account-type
Install Windows updates
http://Windows.Microsoft.com/en-us/Windows-Vista/install-Windows-updates
Updates: frequently asked questions
http://Windows.Microsoft.com/en-us/Windows-Vista/updates-frequently-asked-questions
-
How to run a script for all the images in a folder?
How to run a script for all the images in a folder?
You can assign your script to an action, then use processor by batch or image with the option apply to all subfolders.
-
I am running Vista Ultimate 64 bit and in order to install the internet security package, I need to install SP2. Belongs to this normal windows update or do I have to download it from Microsoft?
Windows Vista SP2 came out mid-2009. You should have gotten a long time ago.
-
I teach online and all my classes have the same user name and password. Now that I clicked "remember me next time", I can connect only in ONE class. How to unlock my login and my password, so that I can use it for all classes. Carol in English
"Remember Me" for the site connections automatically when you return to the Web site is done with a Cookie the site in Firefox.
Try to clear your Cookies for this Web site.
Tools > Options-> life privacy - Cookies = the button show Cookies.
You must use the custom settings for history at the top of this tab to see the View the Cookies button.Enter the domain name in the top search bar and all Cookies for this URL will be displayed. Unless you can figure out which is Cookie to "remember me", you will need to delete them all.
Hold the {Ctrl} key while you click each Cookie in the small window. When this list is all highlighted, click the Cookie delete button at the bottom left.
When you are finished click Close. -
How do I install sql 2008 and sql 2008 R2 on the same user account in vista
I am trying to install sql 2008 and sql 2008 r2 on the same user account and get error message that the account cannot be used. How can I install sql 2008 and sql 2008 r2 on the same user account in vista
Hello
try to repost/ask in the SQL Server forums
http://social.msdn.Microsoft.com/forums/en/category/SQLServer/
-
I am wanting to put the existing files to a new folder, how do I create a new folder and move those file to the new folder?
I am wanting to put the existing files to a new folder, how do I create a new folder and move those file to the new folder?
Hello
Go t the location where you want to create the new folder, right-click and select new/folder. Name the folder.
Go to where the files, select the files and then use the right mouse button to drag the files into the new folder. When you drop the file, a pop-up menu, select the Move option.
Let us know if you have any other questions.
Thank you for using Windows 7
Ronnie Vernon MVP -
I am running Windows Server 2003 R2 and am having a problem with a user profile.
I'm running windows server 2003 r2 and am having a problem with a user profile, we have a logon.bat file that runs to map drives, but also call a logon.html file, that user gets the logon.html appear, but IE blocked then this happens only for a single user, others are ok. Any ideas please?
original title: profile of Win 7 issueHello
Your Windows 2003 R2 server question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the Microsoft Technet Forum. You can follow the link to your question:
http://social.technet.Microsoft.com/forums/en/category/WindowsServer/
Hope the information is useful.
-
How can I create a new folder and add some choose another folder
How can I create a new folder and add some pictures a different folder?
Click Start-> computer. Navigate to where you want to create the new folder. Then, hold down the ALT key and press F. Point again-> file and click folder. Now, you have created the folder if you need to name it. Type the name you want to give the file and press ENTER. Now you have the new folder with the name you gave it. Use him copy / paste to copy the images to the new folder.
Good luck.
-
I am unable to access the Windows XP updates and unable to set up the automatic update. I have not given an error code. I was only told I can't perform these functions. I don't have the windows disk that the computer came preloaded with Windows and I don't remember the Administor password I created 5 years ago. Can anyone help?
Assume that:
http://support.Microsoft.com/kb/316524
You receive an error message 'Administrators' only when you try to visit the Windows Update Web site or the Microsoft Update Web site
http://support.Microsoft.com/kb/189126
Microsoft's strategy concerning lost or forgotten passwords
What I can offer: http://support.microsoft.com/kb/321305
How to connect to your Windows XP-based computer if you forget your password or if your password expires
-
There was a problem that caused some parts of the Connection Wizard Windows Live ID must be disabled. How to fix this?
Hi everyone - I finally got my problem fixed. By chance I stumbled on Omni Tech Support and after several tries, they fixed it for me. I don't know how they did it. I'm sorry that I can't provide the information
For you.
Thank you all for trying to help me.
-
ACS 5.2 How to set up the local user lockout policy?
Hi all!
IM faced with Discover how to set up the local user to the point account lockout policy 5.2 ACS.
4.2.1 there is the option "failed attempts to go beyond", see link for more details:
But to the point 5.2 I can't find the option:
Can somebody spread some light where I configure this?
BR /Crille
Just found a bug number indicating it is not supported.
CSCth12406 Details of bug ACS 5 has no option to disable a local account on the unsuccessful attempts Symptom:
ACS 5 doesn't have an option to disable the local account in the internal identity on failed attempts storeConditions:
When ACS 5 is used to only to authenticate users using internal identity store, there is no way to configure a strategy of locking of account for failed attempts.Workaround solution:
Currently there is no work around -
I went in lightroom and can't find my photos. I lost the link before and did the right click to find and they have been found, but it's different.
I bought an external hard drive and copied some elements but did not cut their. I did a back up on my external hard drive, but even once did not move them. I did the simple troubleshooting and it doesn't work. I'm trying to find the original by right clicking the? on the folder LR and once I find the file it tells me that Lightroom has this file already in the catalog - and I want to merge. I tried one and it disappeared or moved. Help!
Use the file Explorer to see if the images are still in their original location. I suspect that move instead of copy them. This can happen if you drag you the.
I found that it is best to use either right click on a file or folder name and select copy then right click on the drive-destination folder and select Paste or use keyboard shortcuts to copy and paste folder and files from one disk to another. The keyboard shortcuts are the CTRL + key C to copy and Ctrl + V to paste in the selected destination folder-drive.
-
Please help im trying to import images from the SD card and get this set up the following files were not imported because it couldn't be read items 1-100
"Could not be read" indicates that the Destination Directory has no WRITE permission in your operating system.
To resolve this problem, you must
- Determine the Destination folder - it's on the right side of your import under Destination dialog box
- Change permissions in your operating system on this particular file have WRITE permission (or switch the destination to one that has the WRITE permission)
Maybe you are looking for
-
iPhone 6 more screen unresponsive
I have an iPhone 6 and which has a blocking problem intermittent screen, sometimes the top of the screen shows a white dashed line on the top, and when you tap an app on the screen it opens another approx. 75% of the time that the phone works fine. T
-
Cannot restore the link bookmark Add on entry
I use the epubreader add-on. It has 2 inputs/links in your bookmarks button. I deleted the one bookmark recently and this has also removed other that which was below recent Tags and especially Unsorted Bookmarks. I removed the firefox add-on - we (ep
-
My MBP 2012 gets very hot on the bottom on occasion. He also seems to be slow at times especially at the beginning of the session. I ran a check and here's what I got back 11/4HDD/40000000 SATA (0,0). Any help on what's going on?
-
is it possible to use external memory to increase the performance of my computer?
I have a slow xp and each program/app/files in an external drive.But I want to know if I can improve the performance of my control memory left him in the external drive.
-
WD external hard drive not recognized by Vista
I am running Vista Home Premium with Service Pack 2 Build 6002 on a HP Pavilion dv6704nr laptop. I just bought a WD My Passport Essential 500 GB external hard drive with USB 2.0 for PC connection. When I plugged in there first, it did prompt driver i