one drive custom folders sync

bedouinbro

Well-Known Member
Joined
Feb 6, 2024
Messages
44
i want to sync two custom folders with the same name from different directories to Onedrive, found something in this forum

but I'm getting these errors when executing the command
any solutions ?
 
Last edited by a moderator:
Sure, I'd be glad to assist you with this. The procedure mentioned in the forum link involves creating a symbolic link (mklink) in the OneDrive directory that redirects to your desired folder. When you run the command and you're receiving an error, it often implies that:
  1. The command prompt is not run with administrative permissions. Ensure that you right-click on the 'Command Prompt' and select 'Run as Administrator'.
  2. There might be a typing error in the command or some confusion between the placeholder text and what you'll need to replace with your specific data. The command you should use has the following format: mklink /J "%UserProfile%\OneDrive\DesiredFolderName" "Full\Path\To\Your\Folder" Replace DesiredFolderName with the name you want your new OneDrive folder to have and replace Full\Path\To\Your\Folder with the actual path to your target folder. Remember, if any part of the paths includes spaces, you will need to surround the entire path with double quotes. If both your folders have the same name, you might need to give them different names within OneDrive to avoid confusion. For instance, 'Folder1' and 'Folder2' or something more descriptive based on the contents. The names on your local computer can remain the same though. Also, I'd like to mention that symbolic links can sometimes cause issues with some backup and sync services. OneDrive in particular for a while had a bit of an odd relationship with symbolic links. Therefore, always ensure that the sync is working properly by checking OneDrive's status and seeing if the files show up on the OneDrive website. If you're still having issues, please provide the exact error message or more details so we can provide a more accurate solution.
 
these are the commands i executed
PS C:\Users\Mehdi> mklink /j "%UserProfile%\OneDrive\qBittorrentLocal" "C:\Users\Mehdi\AppData\Local\qBittorrent"

mklink: The term 'mklink' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

PS C:\Users\Mehdi> mklink /j "%UserProfile%\OneDrive\qBittorrentRoaming" "C:\Users\Mehdi\AppData\Roaming\qBittorrent"

mklink: The term 'mklink' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.


i have also provided the errors I'm getting
 
it looks like its working

PS C:\Users\Mehdi> New-Item -ItemType Junction -Path "$env:UserProfile\OneDrive\qBittorrentLocal" -Target "C:\Users\Mehdi\AppData\Local\qBittorrent"

Directory: C:\Users\Mehdi\OneDrive

Mode LastWriteTime Length Name
---- ------------- ------ ----
l---- 4/10/2024 2:17 PM qBittorrentLocal -> C:\Users\Mehdi\AppData\Local\qBittorrent

PS C:\Users\Mehdi> New-Item -ItemType Junction -Path "$env:UserProfile\OneDrive\qBittorrentRoaming" -Target "C:\Users\Mehdi\AppData\Roaming\qBittorrent"

Directory: C:\Users\Mehdi\OneDrive

Mode LastWriteTime Length Name
---- ------------- ------ ----
l---- 4/10/2024 2:18 PM qBittorrentRoaming -> C:\Users\Mehdi\AppData\Roaming\qBittorrent

PS C:\Users\Mehdi>


 
Last edited by a moderator:
how do i make the sync in real time ? so when any changes occur in the desktop the data will also be stored in one drive ?
 
so the sync icon isn't changing, it is a blue arrow loop, found a video about it on manual upload it always remains in the blue cycle

anything can be done about this ?
 
in the step 7 im getting this error


also tried closing and starting the one drive but the blue sync icon remains

 
Windows cannot find 'C:\Users\MehdNAppData\Local\Microsoft\OneDrive\onedrive.exe'.
Make sure you typed the name correctly, and then try again.

step 7 error
 
this is the file path for one drive
C:\Program Files\Microsoft OneDrive
 

its resetting
 
Last edited by a moderator:





but the syncing icons haven't changed for the manually added folders if you can analyze the image ( gpt 4 should be able to do it ) that would be great for faster analyzing and response
 
Last edited by a moderator:
so i downloaded the manually backed-up files from the web interface and cross-checked them with the offline files, it seems only the folders with some data even in kb size are downloadable and syncable, the empty folders don't get to auto-sync in the manual upload or maybe there's some leftover cache I need to clear from the PC to sync them completely
 
thanks figured it out. btw I need help with Python language in a windows environment and instant gpt replies like you, is it possible to do this in this forum or do you know about any other forums/sites with gpt bots that reply instantly ?
 
It appears that you're trying to use the mklink command in PowerShell, which is why you're encountering the error message stating that 'mklink' is not recognized as a name of a cmdlet.... The mklink command is a command line utility from the Command Prompt (CMD), not PowerShell. Here’s how to resolve the issue and properly create symbolic links for your OneDrive setup:

Steps to Create Symbolic Links​

  1. Open Command Prompt as Administrator:
    • Click on the Start menu, type cmd, then right-click on "Command Prompt" and select "Run as Administrator".
  2. Use the mklink Command:
    Run your mklink commands in the Command Prompt, replacing them as needed for your specific directories.
    For your case, the commands should look like this:
    Code:
    cmd mklink /J "%UserProfile%\OneDrive\qBittorrentLocal" "C:\Users\Mehdi\AppData\Local\qBittorrent" mklink /J "%UserProfile%\OneDrive\qBittorrentRoaming" "C:\Users\Mehdi\AppData\Roaming\qBittorrent"

Common Troubleshooting Tips​

  • Ensure the Paths Are Correct: Make sure the paths you are providing exist. Double-check that both C:\Users\Mehdi\AppData\Local\qBittorrent and C:\Users\Mehdi\AppData\Roaming\qBittorrent are valid paths on your system.
  • Spaces in Paths: If any part of your folder names or paths has spaces, make sure everything is enclosed in double quotes, as you've already done.
  • Permissions: Since you're already running as Administrator, there shouldn’t be any issue with permissions, but it's always beneficial to check that your user account has appropriate access to the locations you're trying to link.

Validation​

After successfully creating symbolic links, check to ensure they are working:
  1. Open OneDrive: Navigate to the OneDrive folder in File Explorer.
  2. Check for Links: Verify that the new links (qBittorrentLocal and qBittorrentRoaming) appear correctly and lead to their respective directories.
If you follow these steps and still experience issues, please share any new error messages you encounter for further assistance!