Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Running UpdatePSData from a server location

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

  • Hi,

    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.

  • Hi Vidas, thank you for your time in replying. As I wasn't sure that this was the appropriate forum to ask this question I did post it on StackOverflow and got an answer to my initial question and then to a subsequent question.

    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!
  • CNH, if I'm getting this, you just want to run PS from a file share right? The desktop is your "server", then laptop is the "Client". You want to run PS from the laptop but store it on the desktop (or maybe run it on both).

    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.
    1. Close any PortfolioSlicer files that you have open.
    2. On the laptop, if it exists, rename your c:\PortfolioSlicer folder to PSBACKUP or something like that
    3. On the laptop, open a command prompt in administrator mode
    4. Type mklink /D c:\PortfolioSlicer "\\DESKTOP-AG0S799\C Drive Desktop\PortfolioSlicer"
    You should now have a folder off your C: drive on the laptop called c:\portfolioslicer, this is the same location as the file share on the desktop/server. Your PS cmd script files won't be the wiser and will think that everything is in the c:\portfolioslicer folder.

    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.
Sign In or Register to comment.