.bat file - question

akbarza - Mar 11, 2019 at 06:53 AM
 Blocked Profile - Mar 14, 2019 at 07:40 AM
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


1 response

Blocked Profile
Mar 11, 2019 at 08:50 AM
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!
akbarza Posts 3 Registration date Tuesday March 12, 2019 Status Member Last seen March 14, 2019
Mar 12, 2019 at 07:01 AM
first i use windows 10-64bit.
i installed a program. for patch of it i must run a .bat file as instalbat.bat which contains below commands:

@set PATH=%PATH%;%~dp0
arun.exe -patch C:\Mento\ -o License_D.txt

i run this in cmd(command prompt) as administrator. but the below error is shown:
The system cannot find the path specified.
Failed to load package info...

i lose 3 days. i tried many things and searched many in internet. but i couldn't solve the problem.
can guide me?
Blocked Profile
Mar 12, 2019 at 07:48 AM
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
Mar 13, 2019 at 02:17 AM
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
Blocked Profile
Mar 13, 2019 at 07:46 AM
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
Mar 14, 2019 at 07:34 AM
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:


thenks for your help