By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!iff %_elevated eq 1 then
call C:\TCMD\UpdateWinapp2.btm
else
rem start an elevated TCC invisable to do the copying - mentioned in the iff statement above....
start /elevated /inv /pgm "%_CMDSPEC" /C "C:\TCMD\UpdateWinapp2.btm"
endiff
echo.
copy /md "https://raw.githubusercontent.com/MoscaDotTo/Winapp2/master/Winapp2.ini" C:\TCMD\WinApp2_Ini\
echo.
rem convet UNIX to ASCII
TPIPE /input=C:\TCMD\WinApp2_Ini\Winapp2.ini /eol=0,2,0 /output=C:\TCMD\WinApp2_Ini\Winapp2.MSD
echo.
rem copy new winapp2.ini + C:\Users\Galloway\Desktop\Charles Desktop\Annie\custom.ini to %ProgramFiles%\CCleaner\winapp2.ini
copy "C:\TCMD\WinApp2_Ini\Winapp2.MSD" + "%UserProfile%\Desktop\Charles Desktop\Annie\custom.ini" "%ProgramFiles%\CCleaner\Winapp2.ini"
echo.
copy "C:\TCMD\WinApp2_Ini\Winapp2.MSD" + "%UserProfile%\Desktop\Charles Desktop\Annie\custom.ini" "%ProgramFiles%\CCleaner\Winapp2.ini"
[C:\Temp\ff]set u
USERDOMAIN=FF
USERNAME=Admin
USERPROFILE=C:\Users\Admin
When you start a program elevated, %UserProfile% will be the userprofile of admin account, instead of your regular user account.
SET u in the elevated TCC gives me:
Code:[C:\Temp\ff]set u USERDOMAIN=FF USERNAME=Admin USERPROFILE=C:\Users\Admin
You could use the full path (C:\....) or place the file(s) outside the userprofiel.
When you start a program elevated, %UserProfile% will be the userprofile of admin account, instead of your regular user account.
SET u in the elevated TCC gives me:
Code:[C:\Temp\ff]set u USERDOMAIN=FF USERNAME=Admin USERPROFILE=C:\Users\Admin
You could use the full path (C:\....) or place the file(s) outside the userprofiel.
Charles is correct; you cannot run an elevated tab in a non-elevated TCMD.
set password=12345
start "Admin Tab" /TAB /runas admin %password% /pgm tcc.exe
Well, even better! In that case: Just ignore my message ...It works fine as coded....