Batch Scripts / Programs.

Page 7 of 16 FirstFirst ... 56789 ... LastLast

  1. Posts : 7,607
    Windows 10 Home 20H2
       #61

    ricardobohner said:
    My conclusion on this is that the "User Shell Folders" is not completly trustable to get the desktop path....
    Try the following on PowerShell:

    (New-Object -ComObject Wscript.Shell).SpecialFolders(4)
      My Computer


  2. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #62

    Thanks @ricardobohner,,

    ricardobohner said:
    My conclusion on this is that the "User Shell Folders" is not completly trustable to get the desktop path....

    I really thought that I had added that the Scripts applied to the Desktop NOT being relocated. I will adjust Post #1 to state this.

      My Computer


  3. Posts : 4,316
    Windows 11 Pro 22H3
       #63

    The chkdsk wininit results also has the path error.
      My Computers


  4. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #64

    Hello @Hemimax,

    Have you run the command that Matthew posted?
    What was the result?

    It could be because your Desktop has been Relocated to ANOTHER location, as stated in the previous couple of posts.
      My Computer


  5. Posts : 7,607
    Windows 10 Home 20H2
       #65

    Paul Black said:
    the Scripts applied to the Desktop NOT being relocated.
    Consider using the following code to locate a relocated desktop:

    Code:
    Set "[#]=HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\"
    For /f "tokens=*" %%# in ('"PowerShell (GP '%[#]%').'Desktop'"') Do (Set "[#]=%%#")
    For /f "delims=:" %%# in ("%[#]%") Do (
    For /f "delims=ABCDEFGHIJKLMNOPQRSTUVWXYZ" %%# in ("%%#") Do (Set "[#]=%[#]:~1%"))
    Echo   The current desktop is  "%[#]%" & Pause> nul

    My above code is different from the code written by Try3.
    Both codes will remove the junk character, if any, before the drive letter like the one below:



    I don't know where the character comes from.
    It is not a Greek character although the member runs Greek Windows.
    It's all Greek to me.
      My Computer


  6. Posts : 4,316
    Windows 11 Pro 22H3
       #66

    I will check but the others have created the output folders on the desktop.

    Batch Scripts / Programs.-image.png

    I have tested some of other ones and so far only those two have the path error.
      My Computers


  7. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #67

    Matthew:

    Matthew Wai said:
    Consider using the following code to locate a relocated desktop:

    Code:
    Set "[#]=HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\"
    For /f "tokens=*" %%# in ('"PowerShell (GP '%[#]%').'Desktop'"') Do (Set "[#]=%%#")
    For /f "delims=:" %%# in ("%[#]%") Do (
    For /f "delims=ABCDEFGHIJKLMNOPQRSTUVWXYZ" %%# in ("%%#") Do (Set "[#]=%[#]:~1%"))
    Echo   The current desktop is  "%[#]%" & Pause> nul

    My above code is different from the code written by Try3.

    This is the FIRST time that a member has had a problem in the tens of thousands of times the files have been downloaded. I will have a look at the above code at some stage to see if it is also compatible cross-platform [ Runs on Win 7 & Win Vista ]. If you remember, I have mentioned and explained this to you before.

    I thought that I had already added a note to Post #1 saying that the Scripts would NOT produce the correct results [ Folders & Files ] if the Desktop was Relocated, which I have now corrected [ My fault ].

    Matthew:

    Matthew Wai said:
    Both codes will remove the junk character, if any, before the drive letter like the one below:



    I don't know where the character comes from.
    It is not a Greek character although the member runs Greek Windows.
    Who is thana, and what has this got to do with this thread?



    Hemimax:

    Hemimax said:
    I will check but the others have created the output folders on the desktop.

    Batch Scripts / Programs.-image.png

    I have tested some of other ones and so far only those two have the path error.
    Which OTHER file was it please?
      My Computer


  8. Posts : 4,316
    Windows 11 Pro 22H3
       #68

    The chkdsk wininit

    Sorry just trying to help, the SmartScreen was my bad. I don't know why a desktop would get relocated.
      My Computers


  9. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #69

    Thanks for the reply @Hemimax,

    Hemimax said:
    The chkdsk wininit.

    I don't know why a desktop would get relocated.[/B]

    The Desktop would NOT get Relocated by itself as it requires the User [ interaction ] to perform this task.

    As the other Scripts WORK, then we now know that you have NOT Relocated the Desktop.

    Very strange indeed. I ran the Script on my Win Vista, Win 7, and Win 10 machines earlier, and it worked on ALL of them.
      My Computer


  10. Posts : 4,316
    Windows 11 Pro 22H3
       #70

    Just those two so far, I will keep trying the others as time permits.
    I do have some doc folders where I edited the mkdir so they would sync to onedrive, don't know if that is relevant.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:38.
Find Us




Windows 10 Forums