I have a .bat file that makes a call to a .reg file (something like: regedit mytest.reg). I run the .bat file as administrator but I get an error: "Cannot import mytest.reg: Error opening the file. There may be a disk or file system error."
However, if I open RegEdit (as administrator) first then File >> Import >> mytest.reg ... it successfully runs.
Any ideas?
cdto see what the current directory is. – u1686_grawity May 27 '11 at 11:06cd /d "%~dp0"to force to the batch file's location.) Besides, whilecmddoes have many quirks, it doesn't touch filenames you give to other commands - it's entirely up toreghow to treat the file named in, for example,reg import foo\bar\baz.reg. – u1686_grawity May 27 '11 at 11:27\Windows). – Synetech Oct 06 '13 at 05:00subst D: "C:\FolderName". RunningD:\test.regfails while the full pathC:\FolderName\test.regworks fine. – Lilienthal Jul 26 '17 at 10:55