MSFN Forum: DIRCOPY,FILECOPY and RENAME - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

DIRCOPY,FILECOPY and RENAME Rate Topic: -----

#1 User is offline   BritishBulldog 

  • Member
  • PipPip
  • Group: Members
  • Posts: 271
  • Joined: 11-October 04

Posted 29 December 2004 - 01:10 PM

Just finished a version with added copy and rename functions

they are.....

FILECOPY - used to copy files from one directory to another
syntax - FILECOPY from_file_including_path to_file_including_path
example - cmd1[pn]=['FILECOPY %systemdrive%\\RunOnceEx.txt D:\\RunOnceEx.txt']

DIRCOPY - used to copy directories from one place to another
syntax - DIRCOPY from_directory_including_path to_directory_including_path
example - cmd1[pn]=['DIRCOPY %systemdrive%\\test D:\\test']

RENAME - used to Rename files
syntax - RENAME from_filename_including_path to_filename
example - cmd1[pn]=['RENAME %SYSTEMDRIVE%\\RunOnceEx.txt RunOnceEx.old']

anyone want it let me know. I have it for versions 3.1 and above


#2 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 29 December 2004 - 01:14 PM

are you using COPY or XCOPY for this?
what switches does it use? (ex: overwrite, subdirectories, etc.)

#3 User is offline   BritishBulldog 

  • Member
  • PipPip
  • Group: Members
  • Posts: 271
  • Joined: 11-October 04

Posted 29 December 2004 - 01:31 PM

What this actually does is when you use

1. cmd1[pn]=['DIRCOPY %systemdrive%\\test D:\\test']
It changes DIRCOPY to XCOPY and adds /I /E /Y to the end so that the command is
cmd /C DIRCOPY %systemdrive%\\test D:\\test /I /E /Y
So should only be used for directories

2. cmd1[pn]=['FILECOPY %systemdrive%\\RunOnceEx.txt D:\\RunOnceEx.txt']
It changes FILECOPY to COPY so the command is
cmd /C COPY %systemdrive%\\RunOnceEx.txt D:\\RunOnceEx.txt
Only used for files

3. cmd1[pn]=['RENAME %SYSTEMDRIVE%\\RunOnceEx.txt RunOnceEx.old']
stays as it is so the command is
cmd /C RENAME %SYSTEMDRIVE%\\RunOnceEx.txt RunOnceEx.old


just makes the cmd lines easier to add


plus it adds the cmd /C to each line


also added are some extra variables to help with the above commands

%sysdir% - normally 'C:\WINDOWS\System32
%allusersprofile% - path to the all users profile directory
%userprofile% - path to the user profile directory
%appdata% - path to the application data directory
%commonprogramfiles% - path to common program files directory

#4 User is offline   MikeMike 

  • Newbie
  • Group: Members
  • Posts: 17
  • Joined: 29-December 04

Posted 29 December 2004 - 03:36 PM

@BritishBulldog

Is it possible to adress the correct program folder for lets say C:\Program\ComputerABC\ABC
C:\Program FIles\ComputerABC\ABC ?

This path would be different because I use a swedish version of Windows, or is there a %xxxx% command in general?

the copy command works from lets say %cdrom% to %systemdrive%?

I'm kinda new that's why I ask these "simple" questions :P

Thanks!

#5 User is offline   BritishBulldog 

  • Member
  • PipPip
  • Group: Members
  • Posts: 271
  • Joined: 11-October 04

Posted 29 December 2004 - 03:49 PM

Quote

Is it possible to adress the correct program folder for lets say C:\Program\ComputerABC\ABC
C:\Program FIles\ComputerABC\ABC ?
yes it is you can use those.


These variables are already implemented

%systemdrive% - normally 'C:\'
%cdrom% - The CD Drive where WinXP CD is, found by searching for WIN51
%windir% - normally 'C:\WINDOWS'
%programfiles% - normally 'C:\Programme Files' but language dependant

They can all be used,so added with the others this gives you a wide scope


Quote

This path would be different because I use a swedish version of Windows, or is there a %xxxx% command in general?

The variables %xxxx% are in the registry and are different for every language.
%programfiles% in your case will be 'c:\program'
If you open up a cmd window and type 'set' you will see these variables.

#6 User is offline   MikeMike 

  • Newbie
  • Group: Members
  • Posts: 17
  • Joined: 29-December 04

Posted 29 December 2004 - 05:38 PM

Thanks a million!
I only have a little problem left..

when I use this code it works great:

cmd /C COPY %cdrom%\Install\Sem\jul.exe %systemdrive%\jul.exe

but when I want to copy the file into ProgramFiles it doesn't work...

cmd /C COPY %cdrom%\Install\Sem\jul.exe %systemdrive%\%ProgramFiles%\Sem\jul.exe

Can you solve my problem?

#7 User is offline   hasi001 

  • Coder
  • PipPipPip
  • Group: Members
  • Posts: 324
  • Joined: 27-September 04

Posted 29 December 2004 - 05:44 PM

%ProgramFiles% evaluates to drive letter + path

so if the folder's called 'Program Files' and located on C: then %ProgramFiles% would be "C:\Program Files"

in this case %systemdrive%\%programfiles% would evaluate to "C:\C:\Program Files" ... see the problem ?

#8 User is offline   MikeMike 

  • Newbie
  • Group: Members
  • Posts: 17
  • Joined: 29-December 04

Posted 30 December 2004 - 04:50 AM

Yes I see the problem. Thanks for helping me with this, it works great now :D

#9 User is offline   MCT 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 3,288
  • Joined: 19-May 04

Posted 30 December 2004 - 05:00 AM

hasi, do u play to add these commands to your wpi release?

#10 User is offline   hasi001 

  • Coder
  • PipPipPip
  • Group: Members
  • Posts: 324
  • Joined: 27-September 04

Posted 30 December 2004 - 05:14 AM

I do not have Bulldogs version. Can't integrate it.

#11 User is offline   BritishBulldog 

  • Member
  • PipPip
  • Group: Members
  • Posts: 271
  • Joined: 11-October 04

Posted 30 December 2004 - 07:51 AM

here it is, take a look at the generate.js
This is from version 3.2.0

Attached File(s)

  • Attached File  wpi.rar (66.21K)
    Number of downloads: 70


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy