I just developed a browser-based employee management system. I am wondering if there is a way for me to create an installer or a self-extracting file to transfer the system to another computer easily.
I have tried using "iexpress.exe" and "Actual Installer" however it seems they only extract in a single directory. Is there a way for me to specify which file should go to a specific directory using these applications? If none, any suggestions how to do it?
You can make IExpress put files into subdirectories using a technique described by Microsoft. In your install program, you’d need to do something similar to:
#md i386
#xcopy /q /y toastva.exe i386\.
#xcopy /q /y tostrcls.dll i386\.
#xcopy /q /y tostrco2.dll i386\.
#xcopy /q /y toaster.sys i386\.
(You could use move /y instead of xcopy, if that’s what you wanted to do.)
This is due to a technical limitation in the way IExpress generates its CAB file. IExpress generates a DDF file which is read by makecab.exe; this file places all source files in the same destination folder. Thus each source file must have a unique name, regardless of its source directory.
While makecab.exe itself supports subdirectories, the input DDF file is generated on-the-fly by IExpress, so it would be difficult (if not impossible) to intercept it and make changes before makecab.exe reads it.
But honestly, if you need subdirectories (and sub-subdirectories…) then you might want to consider using a "real" installer maker. Some examples in no particular order:
Inno Setup
NSIS
WiX
Related
How can I copy all files/folders in a directory using a batch file but omit one? I know I could always delete it after the fact but it is an extremely large folder and I don't want to waste the time copying it. There are numerous files in the location I want to copy so doing it one individually would be unrealistic. Thank yoU!
robocopy "source" "destination" files_to_copy.ext /e /xd "folder_to_exclude"
robocopy is an upgraded version of xcopy, thus, is more useful. You can check the complete usage by typing robocopy /?, or from the microsoft docs, or from ss64.
EDIT: Almost forgot, robocopy accepts wildcards, so you can type *.* to copy every files. The line I suggest already have the option /e, which will copy all subfolders, even the empty ones. /xf:file_to_exclude.ext can also be used to skip a specific file type, eg. /xf:"*.txt" to exclude all the .txt files.
xf is used to exclude files, xd to exclude folders.
i need something that will move files from one folder to another network location, but leave any locked files that are currently being written to!
any ideas?
apols i am no developer, but i have been trying to use
ROBOCOPY C:\test c:\test\q /move /R:0 /W:0
but even if i open a file, it still moves it to the new directory
mal
You can use for %%f in (*) do move %%f destination\%%f (in a batch file) and just allow each individual invocation of move to fail, watching the errors scroll by.
There are also options for making for %%f work recursively, though that's a bit involved.
I have a large folder of pictures (thousands), and I have a long list of files, by exact file name, that I need to copy to another folder using Windows commands, through cmd prompt only. I use Windows 7.
I want to know if there is a way I can select several specific files from this folder, by name, and copy them to another folder, using the terminal, without copying them individually?.
I know I can do it with xcopy but i want to copy specific types of files only say 'jpeg','bmp',etc.
Try using
xcopy /d /y /s "\Your Image Folder\*.jpg" "C:\Users\%username%\Desktop\Master Image Folder\"
Also you can simply use
copy *.<extension> <other folder>
For example :
copy C:\Users\desktop\*.jpg D:\backup
will copy all files with extension .jpg from path C:\Users\desktop\ to D:\backup\
Something like:
xcopy /s "c:\source\*.jpeg" "c:\destination\"
should do the trick. Additionally, if you type xcopy /?, you should get the documentation. (you can replace .jpeg with whatever file extension you want.
The information on the page Microsoft DOS xcopy command provides considerably more information and guidance.
copy c:\scr\*.jpg c:\dst
copy c:\src\*.bmp c:\dst
I'd like to move my program files and user documents from C:\Windows.old to C:\, completely replacing what's currently in C:. The old and new OSs on my computer are both windows 10, I just had to make a clean install because I couldn't get it to start after a restoration that went wrong. How can I do this operation using the command prompt at windows startup? Is there a command to do this : move, merge folders, replace files with the same name?
Thank you!
First, don't move program files just like that. Programs don't store data only here. Absence of this data might prevent some programs from running, especially licensed ones because they will think it's an attempt of running the executable directly on another computer. A better solution is to reinstall the programs, as it will put everything in the good place to make it is running OK.
Here's the command:
xcopy <Source> <Destination> /s /y
Replace <Source> and <Destination> with their appropriated values. Example:
xcopy C:\Windows.old\Users\David C:\Users\David /s /y
xcopy will ask if it is a file or folder destination. Answer that it is a folder by typing the appropriate letter.
Explanations:The /s command line switch means to copy the entire file and folder structure, while /y means to not ask when overriding files. If you want to look even more geeky, add /f.
I'm trying to create a script that will automatically backup a complete directory tree. I also want it to work for incremental backups. Basically, it wil work like this:
If file is in both source and destination and they are different, source file will be copied
If file is in both source and destination and they are the same, nothing will be copied
If file is only in the source, source file will be copied
If file is only in the destination, destination file will be deleted.
I'm still new to shell scripting and I'm not sure how I could implement this. Any ideas? Windows batch scripts would be better, but shell scripts that run on Cygwin are also fine.
Take a look at rsync tool - it was designed to minimize traffic during files synchronization.
Also, probably "cp" with "-u" argument will be useful:
-u, --update
copy only when the SOURCE file is newer than the destination file or when the destination file is missing
For windows batch scripting xcopy (native to windows) or robocopy (a free download in windows) both work extremely well.
An example xcopy script (in a .bat file):
#echo off
:: /L = list only.
:: /v=Verify, /y=No prompting /s=subdirs /z=Network mode (supports bad)
:: /i=Tells xcopy dest is folder /f=Display names /d=Copy only changed
echo Backing up projects...
xcopy e:\projects h:\projects /V /Y /S /Z /I /F /D
It will even support orphaned files (if you delete something from your source you no longer need a copy in the backup). Xcopy is typically fine for your needs until you deal with sync between NTFS and Fat32 file systems - the later only has a 2 second resolution and problems with daily savings time so you occasionally run into issues: (a) on time change day you might not get a backup of a changed file - depends on change-regularity of course or you might get a backup of all files even though none have changed (b) because of time resolution some files may backup even though they haven't changed.