I am in the process of reconfiguring my home computer system. Simply speaking I have been running PortfolioSlicer on a desktop
I am now intending to run the desktop programme from a laptop, with the desktop being a network location.
On the desktop PortfolioSlicer is located as
C:\PortfolioSlicer this is mapped onto my laptop as
\\DESKTOP-AG0S799\C Drive Desktop\PortfolioSlicer To run UpdatePSData on my Desktop I have created a shortcut to run the batch.
When a I run the shortcut from my laptop I get all sorts of error messages. The initial error is
"CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory."On googling the issue I am directed to “net use”. Unfortunately, I am all “at sea” here.
This is the shortcut that works without an issue when run directly on my desktop.
I have mapped \\DESKTOP-AG0S799\C Drive Desktop\PortfolioSlicer as drive Z:
Can some one help me in modifying the shortcut on my laptop to run the batch on drive Z:
This may not be the correct forum. If no one can help I will go elsewhere.
Comments
First of all, you have to make sure that on the computer you run (in your case laptop), you need to have folder c:\PortfolioSlicer\PSData will all extract data. So if you are opening Excel on your laptop and doing data refresh, you must have c:\PortfolioSlicer\PSData folder with all your data. For this to work, in psConfig.txt you must specify the parameter PSDataFolder:
Also, make sure that DataRootFolder is not specified - so it will use a relative path from where you start your scripts.
You should be able to setup this to run on 2 computers, but full disclosure - I have not tested that. But you should have all "Base" data in one location on your desktop, and on your laptop, you would just create final PSData extract files.
On your laptop create c:\PortfolioSlicer\PSData folder.
On your laptop (assuming disk T is mapped) you should modify your shortcut target to point to T:\UpdatePSData.bat and make sure you also specify "Start in:" property to T:\
Run it and make sure that there are no errors and you have files c:\PortfolioSlicer\PSData folder. If they are there, then refresh Excel workbook.
I will post links to both just in case someone else stumbles upon this problem . For clarification on why this became a question, I am moving home and trying to declutter my desk, hence using the desktop as a server that can be hidden away and using a minimalist workplace with laptop, external keyboard/mouse and hopefully 2 external screens.
https://stackoverflow.com/questions/66853335/running-batch-file-from-a-server-location?noredirect=1#comment118191405_66853335
https://stackoverflow.com/questions/66862503/usebasicparsing-parameter
Again, thank you for your time. I have been using PortfolioSlicer for a number of years and with some extras on PowerBi it is a wonderful tool!
If that's the case, just create a symbolic link on the laptop which points to the file share on the desktop. Call the link PortfolioSlicer and keep it in the root of the c: drive of the laptop -- this way, you don't have to edit the batch files at all b/c the path names are all the same.
If you got a message that you don't have sufficient privilege to run the command, then you didn't open the command prompt as an administrator.