Topics Search

Batch file program to copy folder from one drive to another.

Batch file program to copy folder from one drive to another.
Views: 15
This script needs to be copy folder lets say D:\windows\*me* to C:\windows\*me*. The problem I'm having is the *me* being a variable. So *me* always changes to who ever logs into the machine.

So the real question is how to I make *me* in the file path change to whoever is logged in?
Sponsored Links:

More topics

 

Batch File copy files from CD to a folder

Preview
I'm using a batch file to copy files from a CD to a folder. This command works: copy *.doc foldername. But this command doesn't: copy *.docx foldername.

I even tried copy *.* and *.doc?, but nothing works. in other words, it seems that the batch processor doesn't recognize the newer word formats. Is there some work-around? Maybe I need to use a different batch processor.
 

MD in batch file running under admin privileges doesn't work

Preview
When I run the following batch file in Win7 with admin rights the MD command wont work, but if I run it without admin rights the MD will work but then Drive Image wont work (because it needs to run under an elevated UAC).

L is a network drive (LaCie NAS box). I give the .bat file admin rights by creating a shortcut to it and giving the shortcut admin rights.

From grazing the web it appears this is a known problem in Win7 but none of the suggested solutions I could find worked with my situation.

A key thing is I need the code in the same file as the set command does not persist between different cmd sessions ie I use the %folder% variable in both the MD and the Drive Image lines.

set folder=%date:~10,4%_%date:~7,2%_%date:~4,2%
md L:\DriveImages\%folder%
"C:\Program Files (x86)\Runtime Software\DriveImage XML\dixml.exe" /bc /tL:\DriveImages\%folder%\ /c2 /r- /s- /l
 

Open a file or folder

Preview
You can open a file or folder in Windows to perform a variety of tasks, such as editing the information in a file or making a copy of a file or folder. To open a file, you must have a program that is associated with it. Typically, this is the same program that was used to create the file.
 

Run batch file on selected directory through right mouse button

Preview
I have a batch file that cleans up any picked directory [removes files with specified extensions]
In XP I had it such that I picked a directory, RMB and chose the action.
The instructions to install this facility were: open any directory tools/ folder options.. /file types/file folder/advanced/new...
In Action type<name facility>, In Application used to perform action browse to location of batch file.
Now in Windows7 these instructions don't seem to apply as stuff is in different places. I can make the facility work by placing the batch file in a directory and running it, but this leaves the batch file to be removed and nothing as easy as it was.
 

Batch script for conditional copying and pasting

Preview
I came across the findstr batch command for searching for specific string in a file name. Can the same be used for reading folder names ? ie

I have folders like these:

2008-001
2008-002
2008-003

these are all folder . the number after the '-' indicates a certain number which the user would enter . now I am taking two inputs from the user.

start = some_number
end=some_number

if start = 1 and end =3 . then my batch file should copy all files in these folders
to a certain location . ie the files in folder from 2001-001 to 2008-003
 

batch coping and renaming files

Preview
I have a bunch of folders containing photo sets, and each folder has a file named "cover.jpg" and I was wondering is there a program that will copy the "cover.jpg" fileand rename it to include the folder name where it was copied from so that I end up with a folder containing

cover-SET01.jpg
cover-SET02.jpg
cover-SET03.jpg
cover-SET04.jpg
cover-SET05.jpg

where SET01 is the name of the folder from which the cover.jpg file was copied from.
 

batch file

Preview
I have a batch file on a remote server. if I use remote desktop to connect to this server and run the batch file it runs as I would expect.

However I need to run this batch file from my local machine, using its mapped network drive (example: z:\apps\batchfile.bat)

When I run it from this location it does not run successfully.

Is it possible to run a batch file from a remote server from my machine as if I was running it from the server itself?

Or is there other ways to get round this problem?
 

Windows Explorer runtime error

Preview
If I try to drag and drop an existing folder from one location to another, this causes an Explorer runtime error (see screenshot). Likewise, CTRL-C and CTRL-V of folder causes same error.

However, creating a new folder is no problem; copying/moving file(s) is no problem; and copying/moving file(s) from one folder to an existing folder is no problem.

Bottom line: Cannot copy or drag folder to new location (same drive or different drive). Running XPSP3.
 

Unable to open C: drive: The file does not have a program associated with it

Preview
I have a strange issue that developed after the install of SP-1 for Win 7. When I click on my computer, I double click on the C:\ drive innthe upper center of the screen and I get this error message.

"The file does not have a program associated with it for performing this action. create an association in the Defaults Program Control Panel"

Before SP-1 was installed I could double click on the small graphic of the C drive and it would expand to show the folders. Now I must double click on the left side tree of the computer>C Drive> sub folder that I want to access.

Also sometimes I get a error message saying the computer is looking for a PureHD.msi file but I can not locate this file. Can anyone offer any suggestions or ideas to resolve these two small issues. I have a Dell Win 7 32 bit Ultimate installed.
 

Using batch file to make directories based on file name

Preview
What I need is this:

1. Watch a folder.
2. When any file arrives, create a directory
(using the file name as the new directory name. Created at: Domain/Folders/filename/file)

3. Create a file named download.html, with this in this file:
html
body
a href = http : // Domain/Folders/filename/file
body
html

4. Store download.html in Folders/filename

5. Copy file from Watched Folder to COutput

6. Delete file from Watched Folder

Can this be done with an executable and a scheduler?