## Run flexpde using command line (Error: file does not exist)

General discussions about how to formulate a script for FlexPDE.

### Run flexpde using command line (Error: file does not exist)

Hello, I run flexpde from the command line, for example

flexpde6 -R sample

I successfully open the flexpde program but I got an error ''sample.pde does not exist''

So i have to browse the file manually. How can I make the program see this file?

My system is window 10. Any help would be appreciated.

Preuk
Preuk

Posts: 3
Joined: Sat Aug 29, 2015 2:08 am

### Re: Run flexpde using command line (Error: file does not exist)

Depending on the location of the files, you may need to give a full or relative path to the file. The command line you present will only find the file if it is in the same directory as the FlexPDE executable.

If your command window is in the FlexPDE directory, then you will need to enter something like :
C:\FlexPDE6> flexpde6 \full\path\to\sample

If the sample is on another partition, you will need the partition qualifier. E.g. D:\full\path\to\sample

If your command window is in the sample file directory, you can type a full path to the FlexPDE executable :
C:\path\to\sample> C:\FlexPDE6\flexpde6 sample
moderator

Posts: 733
Joined: Tue Jan 11, 2011 1:45 pm

### Re: Run flexpde using command line (Error: file does not exist)

Thank you very much for your help. I've just realized that it is the issue of command line path.

I moved the file sample.pde into this folder C:\Users\Preuk and I tried this in the command promt

C:\Users\Preuk>flexpde6 -R sample

Everything works perfectly fine.

PS. I tried to change the command line path to be those you gave as the examples:

C:\FlexPDE6> or C:\path\to\sample>

and try to link it to the sample.pde installed in another drive (E:\folder1\)

It did not work, I still dont know why?
Preuk

Posts: 3
Joined: Sat Aug 29, 2015 2:08 am

### Re: Run flexpde using command line (Error: file does not exist)

Yes, this is all about command-line paths and current working directories. If you are not familiar with command-line paths and current working directories then you will want to read up on how they work.

If the terminal's current working directory is the FlexPDE executable directory, then you will need to give a full path to the script you want to run. If the current working directory is the script's directory then you will need to give a full path to the FlexPDE executable. If the current working directory is neither, then you will have to give full paths to both the executable and the script.

I am surprised that you first example worked. You were in the script's directory but did not give a full path to the FlexPDE executable. That should fail because we do not put the FlexPDE directory into the $PATH$ environment variable.

In order to run on a script on a different partition, you will need to include the partition qualifier :
> C:\FlexPDE6\flexpde6 -R E:\folder1\sample
moderator

Posts: 733
Joined: Tue Jan 11, 2011 1:45 pm

### Re: Run flexpde using command line (Error: file does not exist)

I think I got it. I forgot to tell you that when I started to figure out about the command line, I also added flxpde6 folder into the environmental variable path.

I guess that's why my first example worked. Now I deleted it to get back to the initial state and try your latest example. It was perfect!

Thank you again for your help.
Preuk

Posts: 3
Joined: Sat Aug 29, 2015 2:08 am

### Re: Run flexpde using command line (Error: file does not exist)

That makes sense. Adding the FlexPDE directory to your environment path is fine, we just don't do it automatically when we install.
moderator

Posts: 733
Joined: Tue Jan 11, 2011 1:45 pm