New
#31
Dan,
I copied that procedure straight out of my own setting up records and I can now see that there is a missing step - clicking on Change permissions.
I have changed the procedure to
1 Create folder C:\Tools
2 Properties, Security, Advanced
3 Disable inheritance, Confirm convert them into explicit permissions
4 Change permissions, then for each of Authenticated users & Usersselect the list entry for <Authenticated users / Users>,5 Set Owner to Administrators {being careful to use the plural because using the singuar would have a specific meaning that would trip you up}
Edit,
set the check boxes for Read & execute, List folder contents and Read
OK,
Apply
6 Replace owner on subcontainers & objects
If all you have is a Users entry then set that up and you are done. But mine has always listed Authenticiated users as well as Users.
But I think this is putting the cart before the horse. You can set up C:\Tools as a location for your own batch files etc after you have sorted out the current problem.
What are your answers to my questions about
1 whether or not the Admin prompt appears and looks like it is behaving itself, and
2 running the batch file by setting a log file output in its shortcut [>D:\Desktop\MyBatchFile.log]
Denis
This runs fine from an ADMIN DOS window:as shown by the LOG file that gets created (thanks for this good idea) as well as the expected output I was hoping for.Code:"C:\Users\danny\Desktop\danny.BAT" > "C:\Users\danny\Desktop\danny.LOG"
However, when I run this same 'bat' file by right-clicking run-as-admin then the DOS window flashes momentarily and the output I had hoped for does not change, which is obviously telling me the command did not execute (probably because it lost (or never had) the required authorization).
Is there a DOS command I could execute within my bat-file to query if I am running as an ADMIN (or better yet, to request ADMIN status)?
Thanks,
Dan
I was trying to eliminate this as an issue to check through. It will be covered by my step B below.What are your answers to my questions about
1 whether or not the Admin prompt appears and looks like it is behaving itself, and
Change the batch file's shortcut to include the log file output and then run it from the shortcut.
Your shortcut already has the run as Admin property set from what you have posted previously - if not then
1 Right-click on the shortcut
2 [check you have added the output to its Target field]
3 Click on Advanced
4 Set the checkbox for Run as Admin
5 OK, OK
Then you'll just be able toA double-click on the shortcut,- Remember to remove all the Pause lines from the batch file first or you'll just see the batch file's Command window hanging there.
B give Admin approval,
C watch the Command window flicker then
D read the output file in Notepad.
There are more complicated ways of setting up a batch file to run as Admin [some of which have been discussed in this thread already] but, since you are just doing this as a temporary method of fault diagnosis, I do not see the point in doing any more work than is necessary.
Denis
If K: is a network drive, you may have to remap it when running as administrator. Replace "computername" with the actual computer name.
schtasks /run /i /tn "\Microsoft\Windows\Registry\RegIdleBackup"
cd c:\windows\system32\config\regback
dir
pause
if not exist K:\nul net use K: \\computername
copy C:\Users\dan\Desktop\dan-apps\danBM.xls K:\BU\THUMBDRIVE-BM.xls
robocopy C:\Users\dan\Desktop\dan-app\ K:\BU\ METrack.xls
pause
%windir%\system32\shutdown.exe -s -t 0
Ben
Last edited by Ben Myers; 03 Aug 2019 at 16:17.
Try adding "cd %~dp0" after the "dir" command. This changes the working directory to the folder in which the batch resides.
schtasks /run /i /tn "\Microsoft\Windows\Registry\RegIdleBackup"
cd c:\windows\system32\config\regback
dir
cd %~dp0
pause
copy C:\Users\dan\Desktop\dan-apps\danBM.xls K:\BU\THUMBDRIVE-BM.xls
robocopy C:\Users\dan\Desktop\dan-app\ K:\BU\ METrack.xls
pause
%windir%\system32\shutdown.exe -s -t 0
Ben
There is no point in making random changes to a batch file when you could be spending your time diagnosing the problem instead.
Job the shortcut as I have suggested and you will find out what the problem is.
- Make sure you remove all pauses beforehand.
Denis
I think I'm misunderstanding you since when I issue the 'cd' command, this is what I get:
c:\Windows\System32\config\RegBack>dir
Directory of c:\Windows\System32\config\RegBack
08/03/2019 01:12 PM <DIR> .
08/03/2019 01:12 PM <DIR> ..
08/03/2019 01:12 PM 983,040 DEFAULT
08/03/2019 01:12 PM 69,632 SAM
08/03/2019 01:11 PM 32,768 SECURITY
08/03/2019 01:11 PM 109,477,888 SOFTWARE
08/03/2019 01:12 PM 18,219,008 SYSTEM
5 File(s) 128,782,336 bytes
2 Dir(s) 363,965,292,544 bytes free
c:\Windows\System32\config\RegBack>cd %~dp0
The system cannot find the path specified.
c:\Windows\System32\config\RegBack>
It should work properly in the batch file. If you are not comfortable using an unfamiliar command, try eliminating the "cd" line. It may be causing a problem with the rest of the batch.
schtasks /run /i /tn "\Microsoft\Windows\Registry\RegIdleBackup"
dir c:\windows\system32\config\regback
pause
copy C:\Users\dan\Desktop\dan-apps\danBM.xls K:\BU\THUMBDRIVE-BM.xls
robocopy C:\Users\dan\Desktop\dan-app\ K:\BU\ METrack.xls
pause
%windir%\system32\shutdown.exe -s -t 0
Ben