Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

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

- - - - -

  • Please log in to reply
4 replies to this topic

#1
KapnJackSparrow

KapnJackSparrow

    Junior

  • Member
  • Pip
  • 51 posts
  • Joined 01-August 12
  • OS:XP Pro x86
  • Country: Country Flag
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.

Attached Files


Please forgive the many questions, I am learning.


How to remove advertisement from MSFN

#2
Ponch

Ponch

    MSFN Junkie

  • Patrons
  • 3,305 posts
  • Joined 23-November 05
  • OS:none specified
  • Country: Country Flag
you use %HOMEDRIVE% in every line, I guess the install environment has no idea what it means.

Edited by Ponch, 21 November 2012 - 12:26 PM.


#3
KapnJackSparrow

KapnJackSparrow

    Junior

  • Member
  • Pip
  • 51 posts
  • Joined 01-August 12
  • OS:XP Pro x86
  • Country: Country Flag
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?

Attached Files


Edited by KapnJackSparrow, 21 November 2012 - 09:33 PM.

Please forgive the many questions, I am learning.

#4
-X-

-X-

    Member

  • MSFN Sponsor
  • 2,432 posts
  • Joined 08-January 04
  • OS:XP Pro x86
  • Country: Country Flag

Donator

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

cd %~dp0

Download all Windows XP Post SP3 High-Priority Updates with a simple double click @ xdot.tk post-12166-0-42859000-1399044129.png ]
               If someone helps you fix a problem, please report back so they and others can benefit from the solution. Thanks!


#5
KapnJackSparrow

KapnJackSparrow

    Junior

  • Member
  • Pip
  • 51 posts
  • Joined 01-August 12
  • OS:XP Pro x86
  • Country: Country Flag
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, 23 November 2012 - 12:51 PM.

Please forgive the many questions, I am learning.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users