.bat file - question

- - Latest reply: ac3mark
Posts
13036
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
- Mar 14, 2019 at 07:40 AM
hi
i have a .bat file.
i have questions about it that i hope you explain them to me.
( i searched internet but i could not site that explain it to me) :
1) in first line is written :
@set PATH=%PATH%;%~dp0
what's path and what's %~dp0 ?
2) suppose ARUN is name of an executing progran.
whats the mining of the below line especially -patch and -o:
ARUN.exe -patch C:\myfiles\ -o license.txt


thanks
See more 

1 reply

Best answer
Posts
13036
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1460
1
Thank you
1. The path is whatever the path variable is, the dp0 is the directory in which the bat file resides. Do a search for % dp0.

2. Those are parameters passed to ARUN. ARUN is expecting those parameters to complete its operations.

Have fun!

Say "Thank you" 1

Glad we were able to help! Love us? Write us a review! Rate CCM

CCM 6396 users have said thank you to us this month

ac3mark
Posts
13036
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1460 -
You need to set the path variable. What is the path? You must set it.
akbarza
Posts
3
Registration date
Tuesday March 12, 2019
Status
Member
Last seen
March 14, 2019
-
hi ac3mark
i read yesterday about the problem and reached approximately that problem is related to path variable and system path. but i don't know anything about it.is it different from the path that cmd is shown?
from my reading in yesterday, i think the change must be done in ( in win 10) system>environment variable> in path variable, but i don't know in below or up windows .
also i don't know what thing i must add and if i do false if my pc work again or not?
thenks very much for your answer
ac3mark
Posts
13036
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1460 -
No. If the path variable has not been set by the code, then YOU must set it as in:
Set path=c:\somefolder\anotherfolder

Then the path will then be set.
akbarza
Posts
3
Registration date
Tuesday March 12, 2019
Status
Member
Last seen
March 14, 2019
-
hi
suppose my bat file is in C:\modeltech64_10.7\win64
how can add the path? i write in cmd as set path=C:\modeltech64_10.7\win64 . is it's ok?
is restart of pc needed?
explenation: i added in cmd as above guide from you, but i did not restart pc. in cmd i wrote: path
cmd shows the path which is five lines that contains several folder addresses as below:

PATH=C:\modeltech64_10.7\win64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\MATLAB\R2013b\runtime\win64;C:\Program Files\MATLAB\R2013b\bin;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\PROGRA~1\Condusiv Technologies\Diskeeper\;C:\MentorGraphics;C:\modeltech64_10.7;C:\Users\safir rayaneh\AppData\Local\Microsoft\WindowsApps;C:\modeltech64_10.7\win64

when i open cmd the below line is represented:


C:\WINDOWS\system32>

thenks for your help
ac3mark
Posts
13036
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1460 -
Batch files do not require a restart. They are loaded at runtime, not at bootup!
Respond to ac3mark