Skip to main content
12-Amethyst
November 4, 2011
Solved

Working Directory in Creo\ ProE

  • November 4, 2011
  • 1 reply
  • 10111 views

I am having some problems trying to get the working directory to set to the proper folder. I have two batch files wrote, one for network install and one for local computer install.

On the local computer install I can't get the working directory to set right. Whatever I put in the "Start In" box in the Properties tab for the shortcut, is where it always defaults to. However in my batch file I have it set to look at username and designate the working directory based off of who is logged in... This works fine in the network install. the only difference between the two batch files is the Pro E Load Point. The rest is exactly the same. Both load Pro E perfectly with configs and mapkeys. Only difference is I can't get the Working directory to set per user.

I know you can go to File and Set Working Directory but I don't want my users to have to do this everytime so I'm looking for a shortcut and don't understand why it is not working.

Any Help would be greatly appreciated.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
Best answer by BrianMartin

Hi Erik...

Here's what I see... in no particular order:

What is "localdrive" doing? Why is it just "c:" when your "homedrive" is set to "x:\" I don't see localdrive being used anywhere but it doesn't have the same backslash in it. Does this variable come into play elsewhere? If so, maybe this is the issue.

Why is "HOME" being set twice? Right beneath the "localdrive" line, your set HOME equal to \\landoll-eng\cadadm\wildfire5\config. Then later you reset it to %HOMEDRIVE%%HOMEPATH%. Is this intentional?

And finally I think this is your answer... after you check for the existence of the %startupdir% path (and make it if it doesn't exist), add this line:

cd %startupdir%

Literally I think this will fix your problem. Pro/E is inheriting the "startup" location from the shortcut. This is default functionality. The only way to override it, is to change directories within your script. That when when Pro/E fires up, the directory is pre-set to the "startupdir" location. This should do the trick.

Also... if you're in WF5, remember when you hit "File>Open", the menu defaults to the users' "Documents" directory but the working directory should still be set to "Startupdir". I double checked this and it works on my end. Let me know if it does anything for you.

Good luck!!

-Brian

1 reply

1-Visitor
November 4, 2011

I was noticed on Windows 7 64 bit that when space sign " " appear somewhere inside working directory path - the rest after space will be ejected and results of the batch files ore wrong. It was tested and confirmed during modifying postprocessor lists, so maybe in your case this info helps a little...

12-Amethyst
November 4, 2011

I thought that this might be it so I went through and renamed all the folders in the path name to either use a - or _ instead of a space. This corrected a couple issues but no help with the Working Directory. I can upload the Batch file for you to look at...

13-Aquamarine
November 11, 2011

Hi Erik...

Here's what I see... in no particular order:

What is "localdrive" doing? Why is it just "c:" when your "homedrive" is set to "x:\" I don't see localdrive being used anywhere but it doesn't have the same backslash in it. Does this variable come into play elsewhere? If so, maybe this is the issue.

Why is "HOME" being set twice? Right beneath the "localdrive" line, your set HOME equal to \\landoll-eng\cadadm\wildfire5\config. Then later you reset it to %HOMEDRIVE%%HOMEPATH%. Is this intentional?

And finally I think this is your answer... after you check for the existence of the %startupdir% path (and make it if it doesn't exist), add this line:

cd %startupdir%

Literally I think this will fix your problem. Pro/E is inheriting the "startup" location from the shortcut. This is default functionality. The only way to override it, is to change directories within your script. That when when Pro/E fires up, the directory is pre-set to the "startupdir" location. This should do the trick.

Also... if you're in WF5, remember when you hit "File>Open", the menu defaults to the users' "Documents" directory but the working directory should still be set to "Startupdir". I double checked this and it works on my end. Let me know if it does anything for you.

Good luck!!

-Brian