Welcome to MSFN

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


Sign in to follow this  
Followers 0
KapnJackSparrow

using nlite's run once command to copy a folder using a batchfile?

5 posts in this topic

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.bat

PAUSE

again 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

0

Share this post


Link to post
Share on other sites

you use %HOMEDRIVE% in every line, I guess the install environment has no idea what it means.

Edited by Ponch
0

Share this post


Link to post
Share on other sites

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?

post-359142-0-62281800-1353532913_thumb.

Edited by KapnJackSparrow
0

Share this post


Link to post
Share on other sites

try adding this line at the beginning of your batch file...

cd %~dp0

0

Share this post


Link to post
Share on other sites

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 by KapnJackSparrow
0

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.