KapnJackSparrow Posted November 21, 2012 Share Posted November 21, 2012 how do I use nlite's run once command to copy a folder using a batch file?basically I have a batch-file and a bunch of folders included on the disk, the batch-file uses a relative address and is normally able to copy the folders just fine however when I use the run once command in nlite it cannot find the folders, why is this? the command I used in nlite is as follows%SOURCE%\MksTweaks\HD_Icons.reg%SOURCE%\MksTweaks\Copy_Folders.batPAUSEagain it loads the batch-file the batch-file cannot find the folders that should be in the same directory. it also doesn't seem to load the .reg file but that's not too much of a problem if I get the batch-file working.Copy_Folders.txt Link to comment Share on other sites More sharing options...
Ponch Posted November 21, 2012 Share Posted November 21, 2012 (edited) you use %HOMEDRIVE% in every line, I guess the install environment has no idea what it means. Edited November 21, 2012 by Ponch Link to comment Share on other sites More sharing options...
KapnJackSparrow Posted November 21, 2012 Author Share Posted November 21, 2012 (edited) it's possible, but I don't think that's the problem.it sounds more like the batch file is unable to find the source files, rather than the being unable to find the destination. if the batch-file starts in a different folder than it will no longer be near the source and thus will not be able to find them.the problem is that the driver letters change and are unknown before hand... I can try replacing it with static destination and see if that fixes the problem.if that doesn't work I can try giving it a static source like the C drive and keep the %HOMEDRIVE% see if that fixes the problem.Edit: The %HOMEDRIVE% is 100% not the problem. that works just fine.For some reason the batch-file is being loaded from somewhere other than under %SOURCE%\MksTweaks\ and therefore using the ./ relative path for the source folders doesn't work because the batch-file and the folders being copied are not in the same directory.a partial fix for this is going through an alternate operating system and copying the folders to a known absolute path such as C:/ or D:/ before beginning the installation process and then changing the batch-file to copy the folders from there. However I would very much like to keep all dependent files on the on the installation disk as I will not always have this option and I would really like to figure out how to make the path relative since I want to make this installation portable the machines that will have different drive letter assignments.. also my .reg files are not being Merged into the registry which is strange because they are in the same place as the batch-file which nlite is clearly able to find...any idea's on how I can fix these issues? Edited November 22, 2012 by KapnJackSparrow Link to comment Share on other sites More sharing options...
Guest Posted November 22, 2012 Share Posted November 22, 2012 try adding this line at the beginning of your batch file...cd %~dp0 Link to comment Share on other sites More sharing options...
KapnJackSparrow Posted November 23, 2012 Author Share Posted November 23, 2012 (edited) I am trying that now.what exactly does that do? and any idea why the reg files aren't being integrated?it doesn't seem to make any difference. it still cannot find the folders Edited November 23, 2012 by KapnJackSparrow Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now