I have an issue with the directory in my batch files, they will work fine on my computer but not anyone else's because they are pointing to specific folders I need them to point the the current directory they are in any help much appreciated.
This is an example of my current commands:
"C:\Users\Daniel\Desktop\fnr.exe" --cl --dir "C:\Users\Daniel\Documents\vb6\Tare Original\copy" --fileMask "*.frm" --excludeFileMask "*.dll, *.exe" --useRegEx --find "(\w+\sVB.Form\s\w+\s+\w+\s+=\s+)&H00400000&" --replace "$1&H00E4E4E4&"
I need to change the location of the point to the .exe and the copy folder to the current directory?
New to batch files
Moderator: DosItHelp
-
- Expert
- Posts: 1167
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: New to batch files
The current directory as in the directory that the batch script is currently in?
That can be found with the variable %~dp0
Although if the path has spaces anywhere in it, you'll need to use "%~dp0" to preserve them.
That can be found with the variable %~dp0
Although if the path has spaces anywhere in it, you'll need to use "%~dp0" to preserve them.
Re: New to batch files
Thanks dude but i found a solution
"fnr.exe" --cl --dir "%cd%" --fileMask "*.frm" --excludeFileMask "*.dll, *.exe" --useRegEx --find "(\w+\sVB.Form\s\w+\s+\w+\s+=\s+)&H00400000&" --replace "$1&H00E4E4E4&"
"fnr.exe" --cl --dir "%cd%" --fileMask "*.frm" --excludeFileMask "*.dll, *.exe" --useRegEx --find "(\w+\sVB.Form\s\w+\s+\w+\s+=\s+)&H00400000&" --replace "$1&H00E4E4E4&"