New
#11
Kyhi,
Yes, indeed.
What I'm suggesting is, before your set "params=%*" line, insert these lines
and then use the variableCode::: Extract the Registry entry for the Desktop folder [Current user] For /F "usebackq tokens=3 " %%X in (`Reg Query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop`) Do Set DesktopFolderRaw=%%X :: Resolve a result that contains a variable such as %UserProfile% For /F "usebackq delims=" %%Y in (`Echo %DesktopFolderRaw%`) Do Set DesktopFolder=%%Y
%DesktopFolder%
in the rest of the tool in place of your current
%userprofile%\desktop
Denis
Please feel free to edit batch and share your results...
I am more into Windows Rescue Media - as that is a old batch file and not present day...
Please make a note at end of batch and change title date....
Hey Try3 and Kyhi,
Thanks a ton gents, as I'm quite a PC enthusiast (AsusTec Strix 17 GL 703GE Rogers Gamer, Nvidia GeForce GTX 1050 Ti,,nice, however the coding....lol
I will be following this thread.
I think that your OneDrive changes might have relocated some of your user folders. There are lots of ways to check but just for speed of explanation, save this code as a batch file and run it
ShowUserDesktop.batand just see what is shown in the line beginning The DesktopFolder isCode::: Extract the Registry entry for the Desktop folder [Current user] For /F "usebackq tokens=3 " %%X in (`Reg Query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop`) Do Set DesktopFolderRaw=%%X :: Resolve a result that contains a variable such as %UserProfile% For /F "usebackq delims=" %%Y in (`Echo %DesktopFolderRaw%`) Do Set DesktopFolder=%%Y @echo The DesktopFolder is %DesktopFolder% Pause and check the path of the DesktopFolder
I'd also still like to check about which admin account you have been using. When you have to give admin permission to proceed do you just click on a Yes button or do you have to supply the password of a [separate] admin account?
Denis
Agreed. To display many of these variables in PowerShell, you just have to enter this [without even having to use echo before them]
[environment]::GetFolderPath('Desktop')
[environment]::GetFolderPath('MyMusic')
[environment]::GetFolderPath('MyVideos')
[environment]::GetFolderPath('MyPictures')
[environment]::GetFolderPath('MyDocuments')
$env:computername
$env:userprofile
I have never managed to find out how to get a similar PS command to report the path of the Screenshots folder and, if I needed to do so, I'd have to rip it from the Registry.
Denis
Hi Try3,
Thanks so much now the 'silly question' is how do I save the above code as a batch file?
and just see what is shown in the line beginning The DesktopFolder is
The admin account has all permissions as well as %username%----->Click on properties of file/app----->check security...