I have the following command: cd ../../game ^ electron src
that I need to run.
Which basically means step up two folders from our current directory then into the game folder and call electron on the src folder.
However it sees the electron src
command as part of the cd
command... and gives the error can't find the path specified
How can I break it up? so put the electron src
AFTER the cd
command.
This command gets executed inside a NodeJS application like:
exec('cd ../../game ^ electron src', function(...
As you can see I have tried the ^
to break it up but that doesn't seem to solve the problem... I have tried the same code in a Windows command prompt and it happens there so it's not because of the way NodeJS executes it.
Use the following command:
cd ../../game & electron src
The &
means run the first command then run the second.
If you think the first command might fail then use &&
instead.
command > filename
Redirect command output to a file
command >> filename
APPEND into a file
command < filename
Type a text file and pass the text to command
commandA | commandB
Pipe the output from commandA into commandB
commandA & commandB
Run commandA and then run commandB
commandA && commandB
Run commandA, if it succeeds then run commandB
commandA || commandB
Run commandA, if it fails then run commandB
Source Redirection
An A-Z Index of the Windows CMD command line is an excellent reference for all things Windows cmd line related.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments