Tech Problem Aggregator

How to copy a file from 1 pc to another pc in network using batch file

Q: How to copy a file from 1 pc to another pc in network using batch file

Help me make a batch file that copies a file from one computer to another computer in a network...

PC1 = Source
PC2 = Destination

I want to copy a file from PC1's Drive E: to PC2's Drive E:

A: How to copy a file from 1 pc to another pc in network using batch file

Yes I want to copy files from PC1 to PC2 over the network...

PC1's Drive E:\Online Games\Battle of Immortals\Battle of the Immortals
to
PC2's Drive E:\Online Games\Battle of Immortals\Battle of the Immortals

9 more replies
Answer Match 103.32%

Hi,
I have a question  that how to copy file from remote desktop user drive to my local machine using  xcopy or any other protocol.

This is my server path "\\Trail01" and here is the file location "c:\Users\ashique.sheikh\Desktop\Day2.R"
How can i give this is in my batch file. I have used this
net use "\\Trail01" "[email protected]" "/USER:ashique.sheikh"
XCOPY /Y \\Trail01\c:\users\ashique.sheikh\Desktop\Day2.R  "D:\VMI"
But its not working. It is give path error.
How can i download this or is there any other way to do it?

More replies
Answer Match 98.28%

Hi all,

Any idea how to write Batch File .bat to copy file from File Sharing & FTP Hosting to local directory.

Current the File Sharing & FTP Hosting is SMARTFILE.

I don't want to use WINSCP as the connector.

Thanks

A:Batch File .bat to copy file from File Sharing & FTP Hosting

Hi Chacha,

Give this batch file a try. All text in red, you should adjust before running.


Code:
@echo off
(
echo.Username
echo.Password
echo.lcd C:\Some\local\directory
echo.cd /Some/server/path
echo.binary
echo.get Some_file_to_download.txt
echo.bye
) > "%TEMP%\_%~n0.ftp"
ftp -s:"%TEMP%\_%~n0.ftp" "12.34.56.78"
del "%TEMP%\_%~n0.ftp"

1 more replies
Answer Match 94.92%

Hi Guys,

I want to make one batch file which daily copies yesterday's files from one folder & paste it to another folder.

I.e.
C:/111 folder has following files.
1.zip had yesterday's date
2.zip had yesterday's date
3.zip had last sunday's date

now, when i will run batch file today, it only copies 1.zip & 2.zip & move to another folder C:/222

So C:/222 contains following
1.zip had yesterday's date
2.zip had yesterday's date


Please note , i have to run this batch file daily which should not require any changes.

More replies
Answer Match 94.92%

Hi all,

Please help!! I'm having a problem to copy some files from a folder.
My folder have lots of files and is there any way for me to write a batch file to copy only files according to "date modified"? For example last week files or yesterday files.

Please help!! Urgent!!!
Thank you.
 

A:Urgent!! Copy file by date modified using Batch File.

Take a look at XXCOPY: http://www.xxcopy.com/index.htm
 

2 more replies
Answer Match 94.08%

Hi,
I am new to batch files and have read up a little on xcopy and robocopy. 
We currently have a folder which new builds are copied and compressed to .zip files and stuck in a  folder. Dozens of zip files are created every day
What I want to do is the following:

I want to copy the newest zip file from folder 1 to folder 2 and extract it. 

What is the simplest way to find and copy the newest zip file considering multiple zip files are created each day?

A:using a batch file i would like to copy the newest file to a new location.

Try this:
@echo off
for /F "delims=" %%a in ('dir  /b /od "d:\My Files\*.zip"') do set Youngest=%%a
xcopy /y "d:\My Files\%Youngest%" "Folder2\"

3 more replies
Answer Match 88.2%

Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can...

First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg.

Here's the code that I'm using:

ffmpeg -i folder\video.mp4 -f mp3 -ab 160000 -vn "\different folder\music.mp3"

what I would like to do is add to this so that I don't have to write out this code for every file I have... :/

I have the mp4 files in one folder and than the mp3 files are saving to another folder.

So here's an example of what the code will do if it isn't clear yet.

Folder 1:

video1.mp4
video2.mp4
video3.mp4

what it should do is grab video1.mp4 and convert it.

ffmpeg -i folder\video1.mp4 -f mp3 -ab 160000 -vn "\different folder\music1.mp3"

and than move onto the next one

ffmpeg -i folder\video2.mp4 -f mp3 -ab 160000 -vn "\different folder\music2.mp3"

and than the next one

ffmpeg -i folder\video3.mp4 -f mp3 -ab 160000 -vn "\different folder\music3.mp3"

It's going to have to grab the name from the mp4 file and insert it for the mp3 file.

I can get around pretty good in cmd if it's basic commands but when it comes to something like this I'm a little confused...

Thanks for the help in advance!
I'll see what i can do about searching some more on what I would have to do and if I find the solution I'll post it here if it isn't already answered.

A:Batch File that grabs file names from folder to insert into batch file

A DOS "for /f" loop should do the trick, although changing the filename extension for the output to do everything in one line escapes me at the moment.

Perhaps you could do a dir .\folder\*.mp4/s/b > mp4s.txt, then make a copy of that and edit each line to rename the file to the destination name, and save it as mp3s.txt. Then you just feed both the source (mp4s.txt) and destination (mp3s.txt) filesnames into the for /f loop which handles the ffmpeg conversion.

Quite a crude solution and you'd have to handpatch the destination filenames, but i can't think of how to get a source mp4 filename and then just change the extension.

3 more replies
Answer Match 87.78%

I have a text file located at \\thedrive\a folder\another folder\log.txt. This file contains several lines of this kind of data "jdoe upgraded 09-20-2011 13:42:49.62".
I have a batch file located "d:\folderName" that needs to read the "log.txt" file and obtain the local computer user username if it is in the file. If it is not in the file then a file is to be copied to the d drive from \\thedrive\a folder\another folder\ to "d:\folderName" and then run the file. This is what I currently have
@Echo Off
SetLocal EnableDelayedExpansion
::This line is just in case n has been defined before the batch file is run
Set n=
Set _InputFile="\\thedrive\a folder\another folder\log.txt"
For /F "tokens=*" %%I IN (%_InputFile%) DO (
Set /a n+=1
Set _var!n!=%%I
)
but the log file is not read. If I move the "log.txt" off the network it works just fine. I cannot move the "log.txt" file as other processes use it nor can I copy it.
 

A:Batch file to read from a network text file

Because you have Quotes around your file name you need to use the USEBACKQ option.

Please use CODE tags when posting code.

Code:
@Echo Off
SetLocal EnableDelayedExpansion
::This line is just in case n has been defined before the batch file is run
Set n=
Set _InputFile="\\thedrive\a folder\another folder\log.txt"
For /F "usebackq tokens=*" %%I IN (%_InputFile%) DO (
Set /a n+=1
Set _var!n!=%%I
)

 

1 more replies
Answer Match 86.52%

I am trying to copy files from a source directory to an output directory when the output directory already has a file with the following:
../reusable_components/<filename>#.

I already have the following:
findstr /s /i /m "\<../reusable_components\>" *.xml > results.txt
This will return a list of filenames with the text in it.

Now I want to parse the list of files and take out the filename after ../reusable_components. I tried:
for /f %%a in ('findstr /s /i /m "\<../reusable_components\>" *.xml') do (echo %%a)
but that didn't work any ideas?

More replies
Answer Match 86.52%

Does anyone have a simple batch already made to copy? I need to copy everything from my Y:\ drive to my G:\drive. I need it to overwrite original files.. please.. if anyone has it... thanks.
 

A:Copy Batch file

This may work:

xcopy y:\*.* g:\ /a /e /k

Reference:
http://www.computerhope.com/xcopyhlp.htm
 

2 more replies
Answer Match 86.1%

Hello all , i am new to batch programming.

I wish to have a batch file to read .apk file from folder and then copy it to another folder. Then it should rename the copied apk file to test.apk

eg:
i have a file in folder e:\apps\angrybirds.apk , I want to copy this angrybirds.apk to d:\apps and rename it to test.apk

Here the file names in the e:\apps\ will be changing. So what ever may be the name , it should read the name of the file from e:\apps\ folder , copy it to d:\apps\ and rename it to "test.apk" . Test.apk is a fixed rename
 

A:Solved: Batch file to copy a file from folder and rename it in another folder

12 more replies
Answer Match 85.68%

I know there are solutions for this on this forum but I can't get any of them to work in my specific situation.

I have a program that cannot deal with ZIP files and I need to manually sort them out. What I can do is export a partial location for these ZIP files to a txt files so I have:

filelist.txt:
folder\file.zip
folder\file2.zip
...
filder\fileN.zip

What I want to be able to do is create a batch file that will read the location of these files and copy them to a folder. The files are located on a network share but they r are mapped in My Computer. I can modify to the txt file so it gives the full path as a UNC path or a hard path.

I've been trying to get it to work using a For In Do statement but I don't know if that's the best solution. Help would be greatly appreciated. Thanks.

Dilo.
 

A:Batch file to copy files

If you need to replicate the folder structure you need to use xcopy or robocopy.
Posted via Mobile Device
 

2 more replies
Answer Match 85.68%

Is there a simple way to copy an entire folder and its subfolders to another location using a batch file?

Thanks,
Harold
 

A:Batch file to copy subfolders?

8 more replies
Answer Match 85.68%

How do I copy/xcopy a file to the desktop using a batch file? That is, what is the destination to use?Thanks a bunch, Uncle Dewey

A:How do I copy to desktop using a batch file?

%UserProfile%\DesktopOr C:\Users\Public\DesktopOr C:\Users\(username)\DesktopFor Vista

5 more replies
Answer Match 85.68%

Fellow Forum Members,
I have two external hard drives I'm calling Hard Drive A and Hard Drive B. Hard Drive A & B are mounted to external USB cradles. Both USB cradles are connected to the same PC containing Hard Drive C. My objective is to transfer all data files, folders, sub folders from both Hard Drive A & B over to two different hard drives on Hard Drive C.

I need help figuring out Windows 7 so I can accomplish the task above. I have heard of RoboCopy but don't know how to write the script. Does an application such as XYExplorer perform the task of batch copying from multiple external hard drives over to two different folders in an internal hard drive?

How would a RobyCopy Script look like that does the following:

Copy G:\hdA_data1 over to C:\data1_from_hdA
Copy H:\hdB_data2 over to C:\data2_from_hdB
Automatically Turn off computer after copy operation is done


Any info will be greatly appreciated. Thanks in advance.

A:Windows7 Batch File Copy Possible?

Hi,

I haven't had much luck with working out how to turn the computer off automatically, although it can be done.

For the copy process, just usex copy, robocopy gives no benefit since this is a one time? copy of files.


Code:
xcopy G:\*.* /E C:\DataG
xcopy H:\*.* /E C:\DataH
From the cmd prompt:

Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Colin>xcopy /?
Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
[/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
[/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B]
[/EXCLUDE:file1[+file2][+file3]...]

source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies only files with the archive attribute set,
doesn't change the attribute.
/M Copies only files with the archive attribute set,
turns off the archive attribute.
/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
/EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings. Each string
should be in a separate line in the files. When any of the
strings ... Read more

2 more replies
Answer Match 85.68%

hello every onei am just started to learn about batch files, and done some really basic ones So i was just trying out the copy command just to try one for myself, but seem to be getting stuck"EXAMPLE" I WAS TRYING TO COPY C:\TEMP TO C:\Documents and Settings\ROWLEY.PRIVATE-3264A01\My Documents I also tryed copy c:\temp to c:\my documents. but as i am new to this i am doing something wrong can anyone shed any light on this for me. i am using windows xp. Copies one or more files to another location.COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination] [/A | /B]] [/V] [/Y | /-Y]source Specifies the file or files to be copied. /A Indicates an ASCII text file. /B Indicates a binary file. destination Specifies the directory and/or filename for the new file(s). /V Verifies that new files are written correctly. /Y Suppresses prompting to confirm you want to overwrite an existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line.To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).Examplescopy *.* a:Copy all files in the current directory to the floppy disk drive.copy autoexec.bat c:\windowsCopy the autoexec.bat, usually found at root, and copy it into the windows director... Read more

A:Batch File Copy Command

The copy command works on files, not on directories. So, for example, if you wanted to copy all the files in the Temp directory (NOT A GOOD IDEA, BTW - it'll copy a whole bunch of nonsense stuff) to your My Documents folder the syntax would be:

COPY C:\TEMP\*.* TO C:\Documents and Settings\ROWLEY.PRIVATE-3264A01\My Documents\*.*

This will copy everything in the C:\Temp directory to the My Documents directory that's indicated here. The use of the wildcards of *.* means that it will copy everything with entries before the . and everything after the .

It'd be a better experiment (IMO) to just copy 1 text file from the Temp directory to the My Documents directory. In this case it'd be:

COPY C:\TEMP\filename.txt TO C:\Documents and Settings\ROWLEY.PRIVATE-3264A01\My Documents\*.*

You'll end up with a document named filename.txt (if it exists in your Temp directory) in your My Documents folder.

Just for experimentation, try typing "dir *." (without the quotes) at the command prompt. It'll give you a listing of the directories that are located within the folder that your command prompt is open to.

2 more replies
Answer Match 85.68%

What is the command to copy a file from a ThinApp location?
example:
copy "C:\Documents and Settings\all users\Start Menu\PortableApp\Thinstall\Application\%StartMenu%\PortableApps\Register.mny" "Y:\PortableApps\file"
This example does not work, I guess it is because of \%StartMenu%\. Any suggestions

Thanks,

jjblack
 

A:batch file copy command

8 more replies
Answer Match 84.42%

I'm trying to create a batch file that will copy from a source and paste into a destination. I need it to add the date and time to the file name as well.

So far, I have it successfully adding the date with the following code:

ren <file> <file>%date:~4,2%-%date:~7,2%-date:~10%.doc

This works....but I cannot seem to add the time as well.
Any help?

 

A:Simple Copy and Paste Batch File

See if this thread helps?

Or, just copy the files and use a utility like Rename to do the file name changes after the fact.
 

1 more replies
Answer Match 84.42%

I have a folder on a network drive that I would like to copy to another location on another network drive. The source folder should copy over the destination folder, part of the path to the destination folder to be copied over changes based on the person who signs into the PC; OS is XP. This is what I thought would work but hasn?t. Any help would be much appreciated.

XCOPY ?\\Server Name\ Folder1\Folder to be copied? ?\\Server Name\%userprofile%\Folder\my documents\Same Folder Name As in The source folder to be copied over" /E /C /R /I /K /Y

A:Copy Folder batch File Issue

XCOPY ?\\Server Name\Folder1\SourceFolder? ?\\Server Name\%username%\Folder\my documents\DestinationFolder" /E /C /R /I /K /Y

Hope this helps

1 more replies
Answer Match 84.42%

Hi
I am currently running the following to supposedely create a directory IE V:\Backup Folder\Pictures\Backup 21-05-2012
robocopy /e "c:\users\jon\pictures" "v:\Backup Folder\Pictures\Backup %date:~-10,2%-%date:~-7,2%-%date:~-4,4%"

Evrything works fine except the backed up pictures folder is just named as V:\Backup Folder\Pictures\My Pictures

If for arguments sake I backup my outlook file using the above parameters I get what I want EG
V:\Backup Folder\Outlook\Backup 21-05-2012

It's as though there is something within the pictures folder? that is preventing the corrctly named folder from beign created?
The same happens when I try and backup Desktop and Documents folders
What am I missing?

A:Creating Batch File with Robo Copy

  
Quote: Originally Posted by Big Tung


Evrything works fine except the backed up pictures folder is just named as V:\Backup Folder\Pictures\My Pictures


Hi,

I can't quite understand where the \My Pictures is coming from. Do you mind posting a screen capture image of the folder arrangement, so I can see what it looks like?

regards,
Golden

3 more replies
Answer Match 84.42%

Hi all,

To increase our backup solutions, we have decided to backup our SQL database every hour to a folder within the C drive (we couldn't get it to backup straight to a USB drive). So now we need a way (batch file best solution?) to copy these files to the USB drive, lets say every 1.05hours just after they've been created?

Maybe we could copy the entire folder every hour and delete old backups that are in this folder and to the new place for the backups. (although I guess it won't work as it'll have the same folder name once it has been copied).

Or copy the individual files to that new folder although with this they have all different names so is it possible to copy the newest file to the new folder and then after this delete the old backups from a certain time frame?

Big thanks for your help!

A:Batch file to copy files from C drive to USB

Code:
REM Creates a Backup of files every hour
@echo off
:start
XCOPY <source path> <destination path> /w /f /-y
TIMEOUT /t 3600 /nobreak
goto start
This might work, I'm no expert by any means, but the batch file should copy all the files, and then pause for a hour, and then loop back to the start and complete the same process again.

Here's what the XCOPY switches mean - http://www.microsoft.com/resources/d....mspx?mfr=true

9 more replies
Answer Match 84.42%

Lately I've noticed a lot of new Windows users don't really know how powerful command line tools Windows 7 includes.

Here's one, making batch file copy easy and almost automated: Robocopy. To use it, just open the command prompt and type robocopy /? to get all the options. Here's the summary in case you are interested:

-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Usage :: ROBOCOPY source destination [file [file]...] [options]

source :: Source Directory (drive:\path or \\server\share\path).
destination :: Destination Dir (drive:\path or \\server\share\path).
file :: File(s) to copy (names/wildcards: default is "*.*").

::
:: Copy options :
::
/S :: copy Subdirectories, but not empty ones.
/E :: copy subdirectories, including Empty ones.
/LEV:n :: only copy the top n LEVels of the source directory tree.

/Z :: copy files in restartable mode.
/B :: copy files in Backup mode.
/ZB :: use restartable mode; if access denied use Backup mode.
/EFSRAW :: copy all encrypted files in EFS RAW mode.

/COPY:copyflag[s] :: what to COPY for files (default is /COPY:DAT).
(copyflags : D=Data, A=Attribut... Read more

A:Batch file copy made easy

I've been using robocopy for years. It does pretty much all of my backups at home and my laptop backup at work. Most things backup to an external hard drive (or a couple as I like to keep one offsite)

C:\Windows\system32\robocopy C:\users\user1\Documents E:\Backups\PC-name\Documents /MIR /E

That commands mirrors up the source and destination and gets empty folders thus preserving the directory structure.

Robocopy only copies files that have changed...thus subsequent copies are extremely fast.

I highly recommend it.

3 more replies
Answer Match 84.42%

Hello Everyone its me again, I need help on this new file I was making to Add and Delete Mods for Garrys Mod by the few clicks of some buttons.
But I've ran into a problem.

(Im not going to give the whole code because its way to long I'll give shortened version of it.)

Heres what I had before:

IF Not exist "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_charge\init.lua" copy "C:\Users\~\Desktop\Ultimate Gmod Folder\Mods\shoop_da_whoop\Shoop da Whoop\lua\effects\stridcan_charge\init.lua" "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_charge\"
IF Not exist "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_expld\init.lua" copy "C:\Users\~\Desktop\Ultimate Gmod Folder\Mods\shoop_da_whoop\Shoop da Whoop\lua\effects\stridcan_expld\init.lua" "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_expld\"
IF Not exist "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_fire\init.lua" copy "C:\Users\~\Desktop\Ultimate Gmod Folder\Mods\shoop_da_whoop\Shoop da Whoop\lua\effects\stridcan_fire\init.lua" "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_fire\"
IF Not exist "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_mzzlflash\init.lua" copy... Read more

A:Solved: Gmod Batch File Copy Help???

11 more replies
Answer Match 84.42%

Below is a batch file I created to copy all the files from a program called A5V5. This batch file works to copy the files to two different drives What I want to do is if the J: Directory is not availble (This is a flash drive) that it will copy to the E:\ directory which is a second HDD and not leave a "The system cannot find the drive specified" when the flash drive is not inserted.

@echo off
cd c:\
cd program files (x86)
cd A5V5
cd Ranch Mobile, Inc
Copy *.* "E:\Ranch Mobile" (This is a second hard drive for backup files only)
Copy *.* "J:\Ranch Mobile" (This is a Flash drive that is not always inserted)
Pause

Thanks for any help. I like the way batch files work and I can do these simple ones but when it comes to doing the more complicated ones I am at a total loss.

A:How to make a multible copy batch file

Hi AGB,

Welcome to Seven Forums.

Can you try the following and see if this works:

Code:
@echo off
cd "c:\program files (x86)\A5V5\Ranch Mobile, Inc"

Copy *.* "E:\Ranch Mobile"

IF EXIST J:\ (goto jdrive) ELSE (goto end)

:jdrive
Copy *.* "J:\Ranch Mobile"

:end
Pause
This will always copy to your fixed E:\ drive and will only copy to your J:\ drive when exists.
Is this what you wanted?

Regards,
JDobbsy1987

3 more replies
Answer Match 83.58%

I need help with a batch file to copy the contents of my source dir to the destination dir that is to be created with that days date using xcopy or robocopy. Any help is appreciated!

A:Need a Batch File to Copy to a Custom Dest Folder

This should get you started...

for /F "tokens=1-4 delims=/- " %%A in ('date/T') do set DATE=%%A-%%B-%%C
md c:\tmp\%DATE%
xcopy c:\output c:\tmp\%DATE% /s

4 more replies
Answer Match 83.58%

I am trying to write a batch file that will copy my backup files to another drive. For example I currently have the file backed up to C:\Backup\movie backup
I want to be able to copy it to an external HDD: -
X:\Backup Folder\Movie Library, however each time I do this it overwrites the previous backup file.
I want to be able to copy this backup to a new folder each and every time, as follows: -
Today’s backup file would copy to:-
X:\Backup Folder\Movie Library\backup 03-Jul-2010 .......tomorrows would go to
X:\Backup Folder\Movie Library\backup 04-Jul-2010 etc
Can anyone help. I have been looking all day and can't find anything.

Thanx in advance

Jon
 

A:Batch File to copy to Date Stamped Folder

Welcome to TSG!

Use "X:\Backup Folder\Movie Library\backup%date%" as the destination folder name in your batch file. The %date% variable will be expanded with today's date
 

2 more replies
Answer Match 83.58%

Hi,
I have a few questions about my simple batch to copy a Outlook pst file to an external drive. First, robocopy doesn't copy my file; Second, is there a way to prevent the taskeng.exe window from appearing; and Finally, I tried the command "copy" instead and it copies the file but the taskeng.exe window "hangs" and does not continue to restart outlook and therefore close on its own. By the way, the pst file is over 4Gb. Any help is appreciated, thank you!

:: Backup pst file to Server external drive
@echo off
setlocal EnableDelayedExpansion
start "" "C:\Program Files (x86)\Microsoft Office\Office12\Outlook.exe"
taskkill /im outlook.exe /f
@ping 192.168.1.1 -n 5 -w 1000>nul
@ping 192.168.1.1 -n 5 -w 1000>nul
robocopy "C:\Users.pst" "\\SERVER\Outlook Backup\user.pst"
start outlook.exe
cls
@exit
 

A:Batch to copy Outlook pst file to external drive

6 more replies
Answer Match 83.58%

I want to write a batch file that do this for me:

- makes a directory with the "yy.mm.dd.hh.mm" as the directory name,
- copies files and folders from a TEST directory to above destination,
- copies only new (or modified) files from the TEST directory to a separate folder.

Any Idea?

A:a simple batch file for copy files and folders

To create a directory with the date and time as the name, In a batch file use:

set DirName=%date:~-4,4%.%date:~-7,2%.%date:~0,2%.%time:~0,2%.%time:~3,2%
MD \%DirName%

Then in the same batch file use robocopy to copy files to the new directory

robocopy TEST %DirName% /e

you need to add your own paths and read the robocopy help for the right switches you need.
By default Robocopy copies only files that don't exist in the target directory but because you are creating a new directory every time it will copy every thing in TEST

You could use the /A switch which only copies files with the Archive attribute set.

3 more replies
Answer Match 83.58%

I have a usb that I copy files from to new computers. I do this all day and would like to make it quicker.
I will have an XP path and a Vista/7 path, but just worried about XP right now.
The problem is I don't know what drive letter the USB will be in. I thought there was a %thisdrive% switch of some time.

In addition it has spaces and I don't know how to replace spaces in the path. Here is an example;

copy f:\install\105 wallpaper\*.* c:\documents and settings\All users\Shared Docuemnts\Shared Pictures\

Summary;
Determine the USB drive letter?
bridge space issue?
 

A:batch file to copy from usb- unknown drive letter

8 more replies
Answer Match 83.58%

Hi all,

I need a batch file (code) to copy files from last month and zip it for archive. Can somebody help me please?

Thanks!
Samsunlu
 

A:batch file to copy files from last month to archive it.

8 more replies
Answer Match 83.58%

I'm running vista on my computer and would like to be able to copy all log files containing the keyword "error" to a folder called "error logs"
thanks in advance
 

A:How to make a batch file to copy files containing a certain keyword

Welcome to the forum.

use the 'good old msdos' command find

Open command promt en type find /? this will help you see the syntax
 

1 more replies
Answer Match 82.74%

I require a batch file or free utility that i can redistribute from my web site to other users, (gamers) that will copy the contents of a directory inside their game to a new location and re-name the directory at the same time. Something like this;

Copy "Genesis\Vehicles\truck\diesel\4tonbaker" to "Genesis\Vehicles\truck\diesel\4tonbutcher"

The batch file needs to be run without the need for a command line box being opened, that is, if the user can double click on it or run it with a 'right click' that would be great. Problem there is, I maybe need an exe file not a batch file. The other part of the problem is that the folder to be copied may or may not be in the same location on every PC that runs the file. It may be the case that the 4tonbaker folder is on;
C:\Genesis\Vehicles\truck\diesel\4tonbaker or
D:Genesis\Vehicles\truck\diesel\4tonbaker or even
E:\Games\mystuff\Genesis\Vehicles\truck\diesel\4tonbaker

and I require the end user to have no need to know, just for the directory to be copied and renamed when and where it is found.

If possible I then want the batch file to perform a second task. I want to distribute a folder, lets say it is 4tonbutcher and in that folder there are files lets say doc1.txt, doc2.txt and doc3.txt

On any given users PC 4tonbaker has these same named files but the content is different to the ones in my folder 4tonbutcher, I want to update the newly created folder, 4tonbutcher with the new txt files I d... Read more

A:Batch file or Exe to copy & rename directory and update files

Sounds like you need a windows shell program, I'm not expert enough to help you with this

Here's a nice tutorial:

Win32 Shell Scripting Tutorial

Off topic: this is trivial to do in UNIX, I can whip up a shell script for that in no time...

1 more replies
Answer Match 82.74%

I have a list of 1000 files names that I put in a text file named list.txt. Need to find them in more folders, sub folders which has 12000+ files in it. The below script works fine but I would like the Admin Right to be removed and also I want the files to be moved permanently into C:\your_files. Is there any one who could help me in this? Thank you in advance.

@echo off
REM (c) 2013 BY NEUTRON16 (http://www.sevenforums.com/member.php?u=3585)
CLS
TITLE Mass file finder by Neutron16
REM finds files in list.txt file and copies them to C:\your_files
REM CHECK FOR ADMIN RIGHTS
COPY /b/y NUL %WINDIR%\06CF2EB6-94E6-4a60-91D8-AB945AE8CF38 >NUL 2>&1
IF ERRORLEVEL 1 GOTO:NONADMIN
DEL %WINDIR%\06CF2EB6-94E6-4a60-91D8-AB945AE8CF38 >NUL 2>&1
:ADMIN
REM GOT ADMIN RIGHTS
COLOR 1F
ECHO Hi, %USERNAME%!
ECHO Please wait...
FOR /R "%~dp0" %%I IN (.) DO for /f "usebackq delims=" %%a in ("%~dp0list.txt") do echo d |xcopy "%%I\%%a" "C:\your_files" /e /i
COLOR 2F
ECHO.
ECHO (c) 2013 by Neutron16 (http://www.sevenforums.com/member.php?u=3585)
PAUSE
GOTO:EOF
:NONADMIN
REM NO ADMIN RIGHTS
COLOR 4F
ECHO.
ECHO PLEASE RUN AS ADMINISTRATOR
ECHO.
pause
GOTO:EOF

More replies
Answer Match 82.74%

I'm trying to write a .bat that's supposed to handle the very simple task of copying a file to the desktop.

Something like:

copy x:\folder\file.ext [desktop]\file_backup.ext

The problem: [desktop].

It would be really easy if I could simply insert %desktop% the same way as %windir% etc. Unfortunately, %desktop% doesn't exist.

Using the variable for userprofile doesn't work either, because the user may have moved the desktop folder out of the docs & sets folder to any other location, and not necessarily on the same partition or drive.

It would be easy in a .vbs, but that won't work if the windows script host is locked down or disabled.

So it has to be a batch file. Does anyone know how to explain a .bat how to find the desktop?
 

A:Batch file: how to insert desktop location into copy command

16 more replies
Answer Match 81.06%

I am a complete newbie when it comes to batch files and batch file software, so apologies in advance.

I've done some research on Google etc but I seem to just be getting more and more confused trying to use various different scripts and programs and reading different info on various websites.

This is what I need...

I have a folder with around 2000 files in it. I want to be able to copy certain files from this folder (normally around 40) and place them in a brand new folder, I want to be able to do this with nothing more than a txt file that has all the file names I need copying in it with every file name on a separate line.

I receive around 10 new txt files each day so you can imagine how tedious it is searching through 2000 files, picking out the 40 I need, 10 times a day everyday.

To make things even more complicated, the txt files I receive don't always have the correct file names in them, maybe there's a misspelling or a word or two missing for some of the names. That's ok when I'm going through picking out the files I need to copy myself because I can normally tell which file is being requested, but I can't see it being so easy for a program or whatever to do, I'm guessing it'll need to have a search feature where it picks out the most likely file.

I'd like it to be as automated as possible. I receive the txt file, make sure each file name is on a separate line then a program or script or whatever goes out and picks out the files (or most likely files f... Read more

A:search multiple files, copy+paste to new folder (batch file software?)

Contact Rent-A-Coder, Elance, or any of the other programming for hire sites. They could knock this out pretty quickly I would think.

5 more replies
Answer Match 79.38%

I am trying to get some inhouse legacy software to work. This is going to be a bit wordy so hold tight.

Machine using the software: XP

Machine storing the data: Windows 7 Pro

The software is homebrewed. The user selects a vessel and needs to program a hardware key. Our program uses a batch file to call another program. Our program also passes on the vessel's name and path. Striped to the reliant part, this is what is passed to the command line:

Code:
CP32.EXE -U -E"//Font/Master Quad Account/VesselName/Vesselname.128"
With machines running Win XP and Vista this ran without a problem. With Windows 7 the CP32.exe program return a message telling me it could not find the *.128 file.

Other information:

1) Since the Windows 7 machine does not touch a network that is outside of our shop I am currently sharing everything on the machine.

2) I am running the XP machine as an admin. I also created an Admin account on the windows 7 machine that has the same username/password as the XP machine.

3) From the XP machine I can get to all of the reliant folders and have full control via windows.

4) Set up another XP machine. Same problem.

A:Batch file over the network

I don't have an answer for you. this is a very interesting problem.
I am not sure I understand
the syntax. Where the quote marks are used. Without the quote at the beginning I read "-E" as a switch and then I see "//font..." I interpret that part to be a server named "font" with a directory named "Master Quad" and so forth.and this overall represents a complete path. Is that correct?
.
CP 3 2.exe -U -E"//Font/Master Quad Account/VesselName/Vesselname.128"
Kevin

6 more replies
Answer Match 78.96%

Hi all,
I need help to create windows batch file for following requirements.
1. Remove .txt and .log file format in sub folders.
2. Zip individual file inside any sub folders and give file name through command prompt. 
3. Create sub folder zip file include file zip

More replies
Answer Match 78.54%

Can anyone give me the script on how to map network drives through a batch file that starts up & runs automatically when windows initiates?

I have 2 drives that I need to map, both of which are on my home network...

Any help would be AWESOME!!!
 

A:Batch File to Map Network Drives

I seriously can't beleive i wasted the time to post this... i totally forgot about the "reconnect on login"... yea that would save a little time! Thanks though!
 

2 more replies
Answer Match 77.7%

I'm looking for a way to have a batch file run when a network computer is detected.

My laptop is often times inaccessible to my desktop unless I ping it first.
So I've created a batch file to ping the laptop but now I need to find a way to have it run when the laptop is detected on my local network.

Is there a way to do this through a windows event or any way at all?

Any help would be greatly appreciated.

A:Run batch file when network computer is detected

There are applications that can scan a network for a MAC address, but I don't know if any of them support trigger actions when one is found.

I would instead concentrate on fixing the inaccessibility issue. It sounds like the adapter is turning off when the laptop sleeps or after a period of inactivity. That's pretty easy to fix - check your power settings on the NIC and deselect the power saving option.

2 more replies
Answer Match 77.7%

I know how to map network drives with the net use command, but I was wondering if anyone knows how to map network printers using a batch file? Is there a similar command to "net use" that might work for printers? Thanks!
 

A:Mapping Network Printers with a Batch File

http://support.microsoft.com/support/kb/articles/Q189/1/05.ASP
 

1 more replies
Answer Match 77.7%

Right now I've got a batch file to backup from My Documents to a networked drive at work. But I was wondering if there was a way to do this, but check to see if a file has been deleted. I have gotten rid of some files in my documents and they are still on my network drive. If I don't delete them from both at the same time I forget which ones they are.
Anyway, I know this is possible with a 3rd party software, but I wanted to get it done throught his batch file if at all possible, since it is a work computer and I'm not supposed to install anything onto it :evil:

This is what I am currently using.

@echo off
:: variables
set drive=j:\
set backupcmd=xcopy /s /c /d /e /h /i /r /k /y

echo ### Backing up My Documents...
%backupcmd% "%USERPROFILE%\My Documents" "%drive%"

:: use below syntax to backup other directories...
:: %backupcmd% "...source directory..." "%drive%\...destination dir..."

echo Backup Complete!
@pause
 

A:Batch file to synchronize folders over a network

You would not need that at all, if you would set the J-drive's %USERPROFILE%\My Documents as your default in your PC.
(unless your network is slooooowww, or not always available).

Check if your company has Ontrack's (or V-Com's now) Powerdesk (Explorer replacement) available, that has built-in folder synchronisation. Laplink can do the same.

Your current batchfile cannot do that, there are simply no switches for that in xcopy.
 

6 more replies
Answer Match 77.7%

I need to figure out how to setup a batch file to run in a network logon script so anyone in the domain can access there e-mail without having to setup a profile every time they log on to another computer.

[This message has been edited by paulj (edited 07-18-2000).]
 

More replies
Answer Match 77.7%

On my network I have NAS that requires a username and password to access it, and Windows doen't seem to remember the login so I have to enter it each time I start my computer. I wrote a batch file to connect for me to save time and effort (it uses 3 network drives):

Code:

net use S: \\192.168.1.235\mainshare /user:mainshare\guest ******
net use M: \\192.168.1.235\music /user:mainshare\guest ******
net use Z: \\192.168.1.235\public /user:mainshare\guest ******

This works fine on my desktop PC but on my laptop, which uses wireless, it fails at startup because the wireless takes a while and often fails so I have to do it manually. So I'm wondering if there's a way to have the batch file running in the background and then execute that code when it detects a connection to the network (or internet). Windows Live Messenger automatically signs in when wireless connects, so I know it's possible.

TIA
 

A:Execute Batch File on Connection to Network

7 more replies
Answer Match 76.86%

Hi guys,

Looking to this forum for some help with writing a batch file.

I would like to delete 5 day old files from a network share using a sched task .bat to make room for additional daily backups. I have gotten by with very basic batch files before but I really don't know where to start writing this in terms of how to select the 'old' files to delete. The process would also have to include subfolders.

I'd schedule this to run every morning.

The share is, P:\

With many thanks in advance,

Matt
 

A:Delete old files on a network share using batch file

13 more replies
Answer Match 76.86%

Hi Everyone,

I'm new to batch files but I want to create a batch file to run at startup on Windows 7 so when a user logs in with there username and password into the network to see if the Xerox 7535 network printer is installed and if it isn't to install it.

Now because these are computers that multiple users use frequently if I were to do this manually I would need the user to login to the network with there credentials and then open a window and type in //printer_server_name/ and a window would pop up and again they would have to type in there network credentials (username & password) then select the printer Xerox 7535 printer and right click on it and select connect and it would install the printer drivers if needed.

Now when I login as administrator to the computer I can connect to the printer server but when I try to connect/install to the Xerox 7535 printer it doesn't install and I get Error:"0x0000052e so instead I have to have each user login into the computer and install the printer which works that way.

I'm open to any other ways of doing this and I really appreciate the help.

Thanks,

Bill
 

A:How to Create a Batch file to install Network Printers

You can assign a logon script to each user on each computer, the script would be something like this:


Our example configure_printers.vbs script has the following:
Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\util-2\print-brother-1"
net.AddWindowsPrinterConnection "\\util-2\print-hpphoto-1"
' Set the default printer now
net.SetDefaultPrinter "\\util-2\print-hpphoto-1"

Save the file with a .vbs extension

To assign a logon script to a user or group
Open Computer Management.
In the console tree, click Users.
Where? System Tools/Local Users and Groups/Users
Double-click the user to which you want to assign a logon script.
Click the Profile tab.
In the Logon script field, enter the path and name of the logon script you want to assign to that user, and then click OK.


You can place a single copy of the script somewhere inside the Public user directory or you will need to place individual copies inside each user's subdirectory but bury it deep enough so the users won't accidentally delete it.
 

5 more replies
Answer Match 76.86%

Under Win 7 I have a batch file in which I want to include an If Exist statement to determine if a specific Network computer is on the network. I thought something like this would work but I keep getting an invalid path error.

If exist \\HP-Laptop\\ 'do a little something'

Will some please help me out?

Thank you.

More replies
Answer Match 76.86%

I am using (trying) a batch file to initiate a reboot when connectivity to a switch is lost. what I need is to have the PC ping the IP address of the switch and when the connection has been lost, the PC reboots. I have found a few sources and am using pieces of multiple codes to achieve this. The script below works however I also would like to have a couple additional features determined.
PC reboots only after 3 failed attempts
PC pings the IP checking for active connection every 5 minutes
Batch runs on startup
Email is sent after connection is re-established to notify me that there was a loss in connection.
I would prefer to have the batch file performing all the above tasks but have also found that I may only accomplish #2 & #3 by adding a scheduled task in Windows.
Below is the current script I am using. Any information is appreciated.
The issue with the current script is that when there is an active connection the script continues to run. I need this application to every 5 minutes ping an IP or DNS 3 times and if the network state is up the application closes.
Code:

@echo
set ping_ip=127.0.0.1
set failure_count=0
set timeout_secs=15
set connection_error_count=0
set max_connection_error_count=3
:start
:: calling the ping function
call :connection_test

:: Processing the network "up" state
if "%network_state%"=="up" (
echo INFO: You have an active connection.
set connection_error_count=0
) else (
set /a connection_erro... Read more

A:Batch File to reboot pc on network connectivity loss

Do you mean that a failed ping, every 5 minutes for 15 minutes is the trigger?
 

2 more replies
Answer Match 76.86%

Could somebody help me with a quick batch program to remove, network addresses, gateway, broadcast, etc.? Also include cookies, browser history and that sort of thing but really I want the network code if you could help out with that.

I know I could just use ccleaner but this is something that will be constantly worked on until all the functions I want will be in this one batch file instead of possibly running a couple programs.

Used these two but need to know from the experts!!

ipconfig /release
ipconfig /flushdns

Also when the the wireless card is pulled from the pcmcia slot, like to know what wipes any trace of the hard coded ip, mac ip.
 

A:Create a batch file to remove network activity

any help putting this code together for me. windows 7
 

1 more replies
Answer Match 76.86%

Under Windows 7, is it possible to determine if a specific computer is logged in to a network? If so, how?

Thank you.

More replies
Answer Match 76.86%

Under Windows 7, is it possible to determine if a specific computer is logged in to a network? If so, how?

Thank you.

A:Determine if a network computer is online from a batch file

You mean if some other computer is connected and turned on?

If so, the easiest way is to simply ping it, if it replies it's online. If it fails, it's either powered off, or firewalled (by default Windows allows pings from anyone).
You can also use that in bat files, and use the returned errorlevel value for further actions.

2 more replies
Answer Match 76.86%

I am using this command:

Code:
mount -u:root -p:[I][password][/I] \\216.17.1.125\srv\www\htdocs g:
at the command line to mount an NFS-enabled network drive from my Windows 7 machine.

I need to know what I need to put in a batch file (which will be put in my Startup folder), so the drive is automatically mounted at login/startup.

I tried just putting the line above in a batch file, but that didn't work.

Thanks for anyone's help.
 

A:How to Create Batch File to Mount Network Drive

16 more replies
Answer Match 76.44%

I would like to know if there is a way to open a file in a program. Basically I want something like this (this is totally wrong):

open "C:Users\*My name*\My Documents\run.swf" in "C:\Program Files (x86)\Mozilla Firefox\firefox.exe

Thanks
 

A:Create a batch file to open a certain file in a certain file

The more standard way to do that is to use the start cmd. You call the program first and the file name second.

start "" "c:\windows\notepad.exe" "c:\somepath\logfile.txt"
 

2 more replies
Answer Match 76.44%

I'm currently in the process of copying files back from the cloud in the exact same location where I had them before and now it says that the file name is too long and prompts to see whether I want to skip the file or not. The error message given does not
give the full file name or the path so it is impossible to see which files were copied successfully or not. This never happened with XP! Then afterwards I found that some of the files with long names did copy successfully whereas others didn't. I find this
to be a very user unfriendly process and I'm totally confused! These are critical files and I'm sure I haven't exceeded 260 characters or whatever. This is soOoO frustrating!!

C

A:file copy error message not sufficient + file name too long will not copy

Hi ,

There is a limit of filename length within Windows Explorer. In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which
is defined as 260 characters.
The shell and the file system have different requirements. It is possible to create a path with the Windows API that the shell user interface is not able to interpret properly.
This means that your long filename can only be handled at the command prompt level and you cannot drag and drop an illegal length filename within Windows Explorer.

Please simplify your folders and titles.

More information, please check the part of Maximum Path Length Limitation in the link below.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspxTracy Cai
TechNet Community Support

5 more replies
Answer Match 76.02%

I found this snippet of code while searching for things to help me solve the initial problem. It works like I thought it would but I don't understand what the || in the middle of the ping statement does.

Will someone give me a boost here?

Thank you.



Another variation without using any variable
ping racer -n 1 -w 100>nul || goto ingerror ... ingerror echo Host down goto eof :eof exit /b

More replies
Answer Match 75.18%

Hello,

I need help to create an Excel macro that would

1. ask users to select x number of rows to be copied from one worksheet of one Excel file
2. once users have selected the rows to be copied, then the rows are copied from the one original Excel file into X number of target Excel files

Notes:
the target Excel files are all based on the same template
there is one worksheet in each of the target Excel files

in the target files, the rows should be copied from the first available empty row, going down

Looking forward to your help!

Thanks a lot.
Mzz
 

A:Macro needed to copy x number of rows from one Excel file into a batch of Excel files

Hi, welcome to the board.
Not much info there to get the correct picture.
Sample? Of source and template please
And not to forget, what version of Excel are you and the users using?
 

1 more replies
Answer Match 75.18%

I have created a batch file(file1.bat) to run on every machine to create a batch file(file2.bat) to a launch a page at windows startup.
This is the content of file1.bat:
@echo off
@echo>"C:\Users\User\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\file2.bat
@echo start http://www.msn.com/> C:\Users\User\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\file2.bat
Expected result is to copy the file2.bat to startup of each user profile.  However, The file2.bat is not copied to the startup folder on windows 7, 8, 10 after testing.
However, this will work in file1.bat:
@echo off
@echo>"C:\Testing\file2.bat
@echo start http://www.msn.com/> C:\Testing\file2.bat
I do not have a domain joined network.  I need to send the file1.bat to all staff.  I plan to deploy to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup. 

Thanks in advance to all.  Any help is appreciated. 

More replies
Answer Match 75.18%

I have created a batch file(file1.bat) to run on every machine to create a batch file(file2.bat) to a launch a page at windows startup.
This is the content of file1.bat:
@echo off
@echo>"C:\Users\User\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\file2.bat
@echo start http://www.msn.com/> C:\Users\User\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\file2.bat
Expected result is to copy the file2.bat to startup of each user profile.  The file2.bat is not copied to the startup folder on windows 7, 8, 10.
However, this will work on file1.bat:
@echo off
@echo>"C:\Testing\file2.bat
@echo start http://www.msn.com/> C:\Testing\file2.bat
I do not have a domain joined network.  I need to send the file1.bat to all staff.  I plan to deploy to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup. 

Thanks in advance to all.  Any help is appreciated. 

More replies
Answer Match 73.92%

Dear All,

I need to create a batch file which can read the size of file(e.g. 1kb, 2kb...etc) from specific folder and detect 0kb file and convert it to text file (showing 0kb file size) with alarm.

I am not really sure how to write command for this batch file. Please help :-(
 

A:How to create a batch file to read size of file on specific folder path

10 more replies
Answer Match 73.92%

I've been searching the web on how to accomplish this but am coming up empty handed so I am hoping someone here can help...

I want my batch file to read a random line from a text file into an environment variable - can this be done?

I am using Windows 2000.
 

A:Batch File -- Read Random Line from External File into an Environment Variable

6 more replies
Answer Match 73.92%

I'm working on a batch file that will download a file I maintain, look for a string of text, and if it doesn't find the string, rename a file or folder, or change the file or folder's attributes to read-only.

I think I can handle the last part, and I already have the ftp part done, but I am having a hard time finding any good resource for the text string lookup/IF statement.

Any help is greatly appreciated. I'm new here, please excuse my ignorance if I am posting in the wrong area or violating any rules.

Thanks,
Jash
 

A:Batch file to compare text and rename file or driectory on fail

6 more replies
Answer Match 73.92%

I am wondering if anyone can provide the equivalent to this linux script. When run against a text file with one entry per line being the name of a directory, it deletes the named directories.

On linux, I run this against the text list.
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
rm -R $line
done < "$1"

I am not sure how to make it do the same for Windows. I can do this, but I'm hoping there's a way to delete based on what's in the text file. Also, wouldn't want it to prompt for deletion of each, but to just delete.

@echo on
cd \
cd %USERPROFILE%
dir /D /N 0
pause
for /D %%f in (XX*) do rmdir %%f /s
pause
%comspec% /k
pause


Thank you

A:Batch file or command to delete directories named in a text file

It's easiest to clean out the files before removing the directory.
echo Y|del *.* will clean out the files in a directory as long as there are no hidden or system files, you need to remove the attributes of files with the attrib command before the bat will delete the directory.
the echo Y| simply answers yes to any confirmation messages

1 more replies
Answer Match 73.92%

I am trying to write a batch program the list the current directory files that end in *.dwg
into a file on my C drive.
I have used the following code:
dir *.dwg /b >C:FileListing.txt
start notepad C:FileListing.txt

This code only gives file names in the current directory.
I need to have a list of path and file names in the file FileListing.txt
Is there a way to do that without including subdirectories??

Thank you,
 

A:Solved: Batch file to list file names in current Folder.

9 more replies
Answer Match 73.92%

How to create a batch file that will move files based on the file type?

My Requirement : I need a batch file to copy all .doc files in all my HardDisk to a removable disk say (Z: drive) . Can anyone make it possible using a batch file?Please...Its urgent...

A:How to create a batch file that will move files based on the file type

Download XXCopy
XXCOPY, A Versatile File Management Utility --- Boldly Extended Xcopy
This is a vastly improved and extended version of DOS XCopy
Sorry, can't remember the syntax, but its quite simple if you read the manuel carefully :-)
Put the command line in a .bat file and it will run

4 more replies
Answer Match 73.92%

I created this batch file to log certain users logins. It creates a text file to log in, but doesn't populate any of the data to it. Could someone please take a look at it and see what I did wrong. I'm new to writing batch files.

Thanks in advance. Here is the code.

@echo off
set target=JDoe
if %username% == target echo %username% %date% %time% %computername% >> c:\logfile.txt
 

A:Solved: Batch file creates text file but does not populate data to it

target is a variable. You have to surrournd it with %% like any other variable.
Code:

C:\>set target=Squashman

C:\>if %username% == %target% echo %username% %date% %time% %computername% >> c:
\logfile.txt

C:\>type logfile.txt
Squashman Fri 05/23/2008 10:34:14.74 BUMBLE-BEE

C:\>

 

3 more replies
Answer Match 73.92%

Just wanted to know if anyone else is having this trouble. I have a NDAS network media player, my speed sending files to the drive are 4.1 mb/sec. Copying files from the drive to the computer is 10.1 mb/sec.
I have tried every patch or fix I can find. Nothing works.

Vista ultimate 32
Belkin N1 router
Asus P5N-E SLT

Thanks

A:very slow network file copy

Hi Starfox101,

Welcome to the forum.

You might use this tutorial to test and see if it is a TCP/IP Auto Tuning issue.

How to Test the TCP/IP Receive Window Auto Tuning in Vista


You might also try turning off the Windows feature Remote Differential Compression. This tutorial will show you how. You can always just turn it back on.

How to Turn Windows Features On or Off in Vista

Shawn

6 more replies
Answer Match 73.92%

Hi there forum,

how do you change the Visual effects using a batch file or registry file.

Thanks,

Edward.

More replies
Answer Match 73.92%

Hi,

I have a file in a folder on a network drive whose path is : "\\sql\imp\ssis"

I need a windows batch file that looks into the above folder for a file with a name like : "abcd_03052012_84373.txt" .

The above file name has a date embedded in it in "ddmmyyyy" format. I want that to be extracted and put into a variable or a file somewhere so that I can read that later and store into a sql table.

Please help.
 

A:Solved: Extract Date from File Name - Using Windows Batch File

6 more replies
Answer Match 73.92%

I've come into contact with Mandriva Linux. I know of a concept called standard permissions, that it provides. It's pretty convienient. I don't exactly know how it really works under the hood or anything, and I don't need to know exactly how it works right now either, even though it's probably available.

What I want to do, in effect, is create a feature pretty close to equivelant of this feature, only for Windows XP. I want to set standard permissions using a batch file. Whenever this batch file is run as administrator it can enforce the permissions. What are these permissions it enforces? Well, what I want is for these permissions to be gotten from a text file. The syntax in no way resembles the syntax of the Linux file I'm describing.

Basically the syntax is this:
PATH <TAB> MODE <TAB> USER1,USER2,... <TAB> PERM
PATH <TAB> MODE <TAB> USER1,USER2,... <TAB> PERM
...
The path is the path to a file or folder in exact syntax. The mode is one of the switches that can be given for XCACLS in the Windows Resource Kit thingy. This can be replace, edit, etc. The users are the user or group to add/replace/remove/etc, and there is a comma allowed so more than one user or group is allowed to be specified. The permissions are the permissions that you can specify in the utillity.

So the first thing the script needs to do, is call some program that safely detects whether or not the filesystem is NTFS or not. If the sys... Read more

A:Get ACL permissions from a text file enforced by a batch file in Windows XP

16 more replies
Answer Match 73.92%

If anyone can help it will be greatly appreciated,I am taking A + Essentials and my instructor isn't explaining it,

A:How to switch file type name to contents using a batch file for notepad

If you are as it appears you are paying for a Course for a Comptia A+ certification and the teacher isn't doing the job why haven't you gone to the school and asked them to switch you to a course with a different instructor? Or Demand a refund?

When I got my A+ back in 2000 it wasn't that hard to pass. I believe it was two tests and I was over 95% on both with no training course. I was experienced in computers and doing things and They did have a sample test as I recall it.

And of course that old standby Google
http://www.google.com/search?sclient=psy-ab&hl=en&site=&source=hp&q=A+%2B+Essentials&btnK=Google+Search

I'm afraid I can't help you further as the tests have changed a lot over the years.

1 more replies
Answer Match 73.92%

Hi there forum,

how do you change the Visual effects using a batch file or registry file.

Thanks,

Edward.

A:How to change visual effects using batch file or registry file?

Hello Edward, and welcome to Ten Forums.

The links in the blue note box under OPTION FOUR in the tutorial below may be able to help with this.

Visual Effects Settings - Change in Windows 10

more replies
Answer Match 73.92%

I have a computer that is a drone specifically for an outside LED sign. This computer is designed to never shut off and doesn't have any other program on it besides Operating System and the sign software. I need to create a batch file that I can place in the "start-up" folder that will open the program (LEDStudio10) and open the file that I want to play. I have already tried multiple attempts and I was hoping someone out there in sevenforums world would be able to point me in the right direction.

A:batch file open file for program in the startup folder

Task Scheduler. Create a new/basic task. You can invoke your batch script there. This can occur after boot completes, after user logon, etc. You can set it to run daily weekly hourly, etc. You can even have it delay X (preseleted time amounts) minutes/hours after boot/logon if you want.

Task Scheduler - Create New Task

1 more replies
Answer Match 73.92%

More as an alternative to twiddling my thumbs than anything else, I tried to produce a batch file that would count up the number and size of files in a folder, as well as the number and size of files with each extension. Hence it would say how many word documents I have and how much space they're taking up, etc.

I've managed to get a vaguely working model, but the output formatting is terrible (I just wanted it to say X bytes in Y "Z" Files, none of that ugly dotted variable names) and I have failed to get it to equate .htm and .html, .jpg and .jpeg, etc.
Code:
@ECHO OFF
REM THIS BATCH FILE ITTERATES THROUGH ALL THE SUBFOLDERS AND FILES IN A FOLDER (IDEALLY A DRIVE)
REM IT TOTALS THE NUMBER OF FILES CONTAINED IN THAT FOLDER, AND THE SIZE OF THOSE FILES.
REM IT ALSO TOTALS THE NUMBER AND SIZE OF FILES WITH EACH EXTENSION IT ENCOUNTERS.
REM ALL INFORMATION IS THEN PRINTED TO THE SCREEN AND FTYPEDST.TXT

IF EXIST FTypeDst.txt ERASE FTypeDst.txt
ECHO. >FTypeDst.txt
ATTRIB +A FTypeDst.txt

ECHO SCANNING FILE TREE FOR FILE EXTENSION DISTRIBUTION
ECHO Please Wait Paitently. . .

(SET /A ALLNUMBER = 0) & (SET /A ALLSIZE = 0)

REM cycle through the current directory and subs, Increment Allnumber, Allsize, define and increment Number of * files, size of * files.
FOR /R %%F in (*) DO (
SET /A ALLNUMBER += 1
SET /A ALLSIZE += %%~ZF
IF NOT DEFINED Number.of.%%~XF.files (SET /A Number.of.%%~XF.files = 0)
IF NOT DEFINED Size.of.%%~XF.files (SET /A Size.of.%%~X... Read more

A:Solved: File Type Distribution analysis: Batch File.

Posted via Mobile Device
You would be better off using third party software that already does this. Plenty of them out there.
I personally would check the extension of each file using the cmd extensions of a for loop. then do an if statement for each file type you want to keep track of. then use a call statement to branch to a function that adds up the file sizes and number of files.
 

3 more replies
Answer Match 73.92%

Hi . I'm making a "PC TuneUp" project , but something is wrong . When the batch file tries to check for updates , it closes . Fortunately , i know that it closes because it doesn't find the file . But i tried everything - nothing worked . Please help !
Code:

@echo off
for /F "tokens=1" %%G in ('tasklist /V /NH /FO TABLE /FI "WINDOWTITLE eq TehDansorz"') do IF %%G==cmd.exe exit /b
if exist newest%winver%pctuneup.ver del newest%winver%pctuneup.ver
if exist %winver%pctuneup.ver del %winver%pctuneup.ver
set winver=Win7+WinVista
set ver=1.6a
set title=title TehDansorz's PC TuneUp for Win7/WinVista Version %ver%
title Requesting admin permissions ...

:: BatchGotAdmin
::-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Administrator privileges are required for this app to work .
echo Please click OK in the following screen .
PING 1.1.1.1 -n 1 -w 600 >NUL
goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

"%temp%\getadmin.vbs"
exit /B

:gotAdmin
title Got a... Read more

A:Solved: Batch file closes when downloading version file

7 more replies
Answer Match 73.92%

I want a batch to select and open a random link file in a folder i have. All the links are music videos I like to listen to, and I kind of want to just have an option for 'surprise me!'.
I can change the file names if I have to, and I have a basic batch file ability. I know the simple commands, but nothing of the variables, signs-involving commands (&%!?), etc.

Also, I want to learn a whole lot more about programming/java/batch file, so it'd be awesome if any code could be explained. Thank you, in advance

A:I need a batch file to open a random file within a certain folder/path

There's a free Windows scripting language called Autoit3 that would do this task easily using these functons:

Random
_FileListToArray

AutoIt - AutoItScript
It has a Basic like syntax and is easy to learn.

Another popular scripting for Windows is AutoHotkey
AutoHotkey: macro and automation Windows scripting language

The syntax can be confusing but it has object support and is more powerful.

Of course there are tons of others for Windows:
Rexx
Python
Perl
Ruby

Here's a list. The details for each tell which OS are supported:
Free Programming Languages - Freebyte's Guide to

5 more replies
Answer Match 73.08%

So I recently had a case of hard drive failure in which basically nothing of value was recovered in the original directory structure, however the drive was full of .chk files from a chkdsk run. I ran a quick script to change all of the extensions to .jpg, and most of the files were in fact intact.

Many of the files, however, are either corrupt, or are simply not JPEG files, and so will not open with the .jpg extension. Is there any batch renaming application that can analyze files by their header data, and append the appropriate extension automatically for the most commonly used filetypes?

A:Batch file extension processing by file header?

Usually file recovery software does that (before the files are recovered as chk files). I don't know of any app that will do what you said though. But if you don't have too many files, use a hex editor to open them and rename accordingly. I use winhex (just for viewing though), but any other will do. Here's a few strings that may help:
JFIF .jpg
RIFF AVI LIST .avi
PNG .png
MZ .dll or .exe (at least 32-bit - dunno how they are for 64-bit or 16-bit executables)
moov somewhere in the file .mov (may not be at the beginning)
GIF89a .gif
ftyp .mp4
**\rtf1 .rtf
000001BA21000100 (in hex) .mpg (MPEG-1 at least - don't have MPEG-2 samples to test ATM)
3026B2758E66CF11 (in hex) .wmv or .asf

5 more replies
Answer Match 73.08%

On my XP backup batch file, I am doing a comparison of the total files in the source and target directories to confirm they are the same (and consequently everything backed up ok). What I am trying to do is display the final file total line, excluding all of the other file total lines of the individual folders. Additionally, I want to exclude system files from the total, as I am not backing them up.

I am using "dir /s /a-s d:\*.* | find "File(s)"

This give me the total lines of all folders in addition to the final total files and bytes which is the only line I want.

I have used attrib with find /c /v "", which works, however I cannot find a switch with attrib that will exclude system files.

Any ideas?

A:Batch File find final file total

Try this look for /exclude (scroll down)

2 more replies
Answer Match 73.08%

Anyone know how to take the contents of a text file, numbers only, calculate and then store them as a value? I'll be constantly adding to this text file and they need to be calculate. Like the balance of a bank but a little different.
 
Please and thanks!

A:Batch File, Calculating the Contents of a Text File

I think that would actually be very hard to do as the numbers in your text file are not integers but text and doing calculations would not be possible. Is there any reason you can't use a spreadsheet to do this?

10 more replies
Answer Match 73.08%

Alright, so what I'm trying to do is list all the shortcuts & folders in the start menu and list all the shortcuts & folders on the desktop and put this into a text file. The reason is to get a full list of programs our teachers use before we re-image their machine and not all of their programs are listed in add/remove programs and not all programs make a folder in Program Files, that is why I'm trying to do it in this roundabout way. What I have so far is this:

@echo off
mkdir "p:\Program List"
DIR "c:\documents and settings\all users\start menu\*" /S/B/OD > "p:\Program List\%computername% Start Menu.txt"
DIR "c:\documents and settings\all users\desktop\*" /S/B/OD > "p:\Program List\%computername% Desktop.txt"

This works perfectly but the only problem is the file has these:
c:\documents and settings\all users\start menu\
c:\documents and settings\all users\desktop\

before each entry in the text file. Is there an easy way to remove these lines so the text files are easier to read? I've checked other sources and can't figure out how to get this to work...

A:[SOLVED] Delete text from .txt file in a batch file

Open the files in Notepad, click Edit, then replace, and enter the string C:\Documents and Settings\All Users\ and replace it with nothing (no entry).

:)

10 more replies
Answer Match 73.08%

I need to write a batch file or vb script that will take the following share names (which are stored in a .csv Excel file) and then run the following command:

NET USE \\[entry from 1.csv file]

The object is to have this command establish a NET USE connection to each share name from the 1.csv file.
These are the first five entries from the 1.csv file:
\\s0002234\c$
\\s002631\c$
\\gb2130\c$
\\s00460\c$
\\gb2143\c$
\\gb3205\c$

Can you please write a command script that will do this for me? My OS is Windows XP Service Pack 2.
Contact me with any further questions.
Dennis
[email protected]
 

More replies
Answer Match 73.08%

Hi,

I want to write a batch file to add the numbers. The inputs are in the text file. I need to add all the numbers in the text file that are in consequent lines. Please help me in doing that by giving an example.

Regards,
Menaka B
 

A:Batch file that takes input from text file

7 more replies
Answer Match 73.08%

Hi,

Can anyone tell me how to get part of a bacth file to read a line from a text file and then set it to a variable.

For example the file contains computername =computer1

how do i get the batch to read that and set computer1 to a variable that can be used within the batch file.

If possible what i would also like to be able to do is once set that to variable, compare it against the correct computer number and if incorrect go back into the batch file and set the line to the correct computer name

Any help is appreciated.

Thanks
 

A:Batch File Read Line Of Text File

7 more replies
Answer Match 73.08%

I am wondering how to write a script that would delete all files of a certain extension from a folder.
 

A:Solved: Batch file to delete all .xxx files from a file

6 more replies
Answer Match 73.08%

Backround: I am a college student majoring in Information Technology with a focus in programming. I also work for my school's IT department as an IT associate. I have 4 years of experience dealing with hardware and software and have studied Net+ and A+ certification books.

Problem: At my school my boss, the IT Director, wants to schedule a batch file to run weekly that will delete items from the desktop and folders of the "Student" account on all of the student computers. He asked us associates to go around to every student computer with this batch file on a thumb drive and schedule the task. Seems simple enough right? The problem is we are talking upwards of 300 computers throughout the campus. I proposed a solution to him where we would use a script that would essentially consult a text document with the names of all of the student computers in it, then run the file.

I am 99% this can be done, I just have a very small amount of programming experience. If anyone has an answer or knows of an easier way to accomplish this I appreciate it. Thanks in advance.

EDIT: All student workstations are running Windows XP SP2
 

A:VB Script to Run a Batch File and Utilize a Text File

16 more replies
Answer Match 73.08%

Hey I've written lots of batch files before, but it's been a while and I don't think I've ever tried to add external data.

I've got a list of folder names and I'd like to make a batch file that I can run every once in a while to copy a master file in each folder to a new file. I know this is long, but I know exactly what I want so I thought I'd be as specific as possible. I'd love to get an example script but I really do want to learn more--if I could get pointed in the direction of where to learn this stuff, that would be awesome.

So for instance the folders are:
folder1
folder2
folder3

And in each folder there is a master file that includes the folder name and the word master (for instance):
c:\folder1\folder1-master
c:\folder2\folder2-master
c:\folder3\folder3-master

And I want to copy the files to a new file:
copy c:\folder1\folder1-master folder1-copy
copy c:\folder2\folder2-master folder2-copy
copy c:\folder3\folder3-master folder3-copy

Now I don't want to do every folder every time I run the batch file, but I already have a list of the files that I have to make copies of. So I was hoping to have a text file with:
folder1 folder2 folder4 etc

Then the batch file would grab that info and run a loop till it ran out of info. So if the first data was folder1 it would put folder one in %data% or something and then:
copy c:\%data%\%data%-master c:\%data%\%data%-copy
Then the loop would go back and put the second data in %data%... Read more

A:more complex batch file data from external file

7 more replies
Answer Match 73.08%

Okay, so basically, I have a whole list of links in a plain text Notepad file, each link on a seperate line. All I am wanting to do is to add a bit of text before each link, specifically: 127.0.0.1 and a couple of spaces.

So this...
Code:

[SIZE=3]somelink.com[/SIZE]
becomes this...
Code:

[SIZE=3]127.0.0.1 somelink.com[/SIZE]
By now you've probably already guessed what I'm trying to do here and what it's for.

So I am wanting some batch file code, executable in a .bat file, which basically reads a Notepad text file, and then add "127.0.0.1 " at the beginning of each line with text on it. I am guessing this is probably a very simple piece of code for someone with some knowledge of MS DOS and batch file code, but that most certainly isn't me, and the only batch files I have ever written have been with help like now.

Thanks for any and all help in advance with this, much appreciated.
 

A:Batch File To Read And Modify Text File

9 more replies
Answer Match 73.08%

I wrote this batch file which does what I want it to do so far.


Code:
@echo off

"C:\Users\xxxxxx\Documents\HideTaskbar\HideTaskbar.exe"
"C:\Program Files (x86)\VideoLANold\VLC\vlc.exe"
"C:\Users\xxxxxx\Documents\HideTaskbar\ShowTaskbar.exe"

exit
VLC is a video program so I want to associate video files to this bat file. This would mean that when i clicked on a video file in Windows Explorer, the bat file would execute and VLC would open the file I double clicked. At the moment the only thing that happens in this setup is that the bat file executes like normal but no video is played.

Is this possible, and if so how can I accomplish it?

A:How can I write a batch file that opens a file in a program?

Have you tried associating the video files to open with VLC by default ?
Maybe you don't need a BAT file ?

Default Programs - Associate a File Type or Protocol

9 more replies
Answer Match 73.08%

Any suggestions here would be appreciated but I think this is so bizzare or deep into Windows that I'm not expecting any. I am developing a scheduled task that will run every morning unattended. The script starts Excel and specifies a workbook to open. The 'workbook_open' event runs and when finished, starts another batch file (via Shell(batFile, 1) and shuts down Excel. The 'batFile' starts Access and specifies the database to open. The database runs an AutoExec function and then shuts Access down. This sequence runs fours times for four separate databases. Here's the problem:

When the scheduled task runs under my account, everything works fine. However, when we change the scheduled task to run under the System Administrators account (we have to do this for reasons not important here), the Excel/Access sequence for one, and only one, of the databases does not run. I have isolated the problem to the 'Start' commands for both Excel and Access. What appears to be happenng is that for the Excel 'Start', Excel starts but the 'specified' workbook is not opened, hence Excel just sits there as an open process not doing anything. When I changed the name of the 'specified' workbook, the Excel 'Start' works okay, opening up the renamed workbook. The same thing happens with the Access 'Start' command. Access starts but the 'specified' database does not open, hence Access just sits there ... Read more

A:DOS Batch 'Start' app file command cannot find file

I've found a workaround to this problem by renaming the parent folder to which the database's location folder trees. But I sure would like to know what caused this problem.
 

1 more replies
Answer Match 73.08%

Hi, I was wondering if it is possible to make a batch file that will open a file with a specific program?

Say I want to open "targetA.txt", with the program "noteviewer.exe"
Is it possible with batch file? or not?

If it is, could you please show me how?
 

A:making a batch file open a file with particular program?

10 more replies
Answer Match 73.08%

Greetings:

I was wondering what the best approach would be for the following:

I have a network drive that has roughly 300GB of data
I have a system with RAID 5 with 460GB of usable space for backing up this drive

We are trying to create a mirror of the shared drive before we do a conversion process and backing up to a tape is not possible. would xcopy be the best solution? how bout windows backup?

any thoughts would be great!
 

More replies
Answer Match 73.08%

Hi
i am trying to copy from XP home laptop to Vista Desktop.
The the copy is real slow almost 200KB/s same as my internet download speed(sometimes my interenet speed is faster than n/w copy).
Copy operaion on same drive on desktop is real fast almost 20MB/s
i read lot of posts about it & tried following thing
1)installed hot fix KB931770
2)Disabled Remote differential compression feature
3)tried stopping ip helper & Computer browser service
4)tried disabling firewall & anivirus program
5)auto updated the windows vista from MS site

i dont know what to do now. i have already wasted lot of money & time figuring this thing out
any help is appreciated. otherwise i have to uninstall & install some different OS
is there any way i can return the windows vista & get my money back?

Thanks,
Vinod
 

A:Vista network file copy slow

12 more replies
Answer Match 73.08%

I am trying to use this .bat file to copy folder "X" from a pc on my network to folder "Y" on the local pc
but it does not work ??

echo off
cls

echo Would you like to do a backup X ?

pause

robocopy "\\***.***.*.*\C:\X" "C:\Y"

pause
 

A:.Bat file to copy folder from network to local pc

Obfuscating the IP address is pretty pointless. Your lan is using private IP addresses that are not routable to the Internet.

Regardless of that, it looks like you are trying to access the administrative share of the server. Administrative shares are accessed using a dollar sign.
 

1 more replies