Search found 80 matches

by RElliott63
02 Mar 2009 13:27
Forum: DOS Batch Forum
Topic: Copy multiple files to different directorys
Replies: 7
Views: 8645

Put an "@Echo Off" as the first line of the script. That way the only thing you will see is the "Echo" statement as it happens.

-R
by RElliott63
02 Mar 2009 09:24
Forum: DOS Batch Forum
Topic: Copy multiple files to different directorys
Replies: 7
Views: 8645

Inside your loop, just add a test for the Folder. This assumes you're looking for folder names that match the File Name of the ID files in the "C:\Test" folder. For /F "Delims=" %%F In ('Dir /B C:\ID\*.id') Do ( Set "f=%%~nF" If Exist c:\test\!f! ( Copy ...
by RElliott63
02 Mar 2009 07:23
Forum: DOS Batch Forum
Topic: Copy multiple files to different directorys
Replies: 7
Views: 8645

This should get you going down a path that would help... with some tweaking. -Rick SETLOCAL ENABLEEXTENSIONS SETLOCAL ENABLEDELAYEDEXPANSION For /F "Delims=" %%F In ('Dir /B *.id') Do ( Set "f=%%~nF" If NOT Exist \\Server\NotesProfiles\!f! ( MD \\Server\NotesProfi...
by RElliott63
28 Feb 2009 22:07
Forum: DOS Batch Forum
Topic: block character renders my batch files useless
Replies: 1
Views: 3862

What editor are you using?
by RElliott63
24 Feb 2009 15:57
Forum: DOS Batch Forum
Topic: .Bat file to kill processes upon confirmation
Replies: 4
Views: 7004

Steve, This: SET /P "YN=Are you sure? (Y/N): " IF /I [%YN%] EQU [N] (GOTO:START) Means: Prompts the User for a Y or N to make sure before killing the task. This: TASKKILL /F /IM "%PROCESS%" Means: If the user does NOT type "N" above, then process the TAS...
by RElliott63
24 Feb 2009 12:33
Forum: DOS Batch Forum
Topic: How to format time?
Replies: 1
Views: 8749

I have this snippet inside a "GetDate" script that I call all the time. Put this into a "GetTime" script and call it. Then do a "Set Time." from a command prompt and use the var that you need in your code. as in: ... Call GetTime Set Log=LogFile-%time.HHMMSS%.csv ... -R...
by RElliott63
23 Feb 2009 10:51
Forum: DOS Batch Forum
Topic: Batch File Help Need: Zip all files before the current date.
Replies: 2
Views: 5115

Based on your system date (%Date%) being something like "02/23/2009", you could start with something like: Set "WD=%Date%" Set "dMM=%WD:~0,2%" Set "dDD=%WD:~3,2%" Set "dYY=%WD:~6,4%" Set "dYY2=%WD:~8,2%" Set "dMMDDYYYY=%dMM%%dDD%%dYY%&...
by RElliott63
23 Feb 2009 10:38
Forum: DOS Batch Forum
Topic: need help triming data out of a file
Replies: 1
Views: 4313

The only way I can see doing this is that during your capture of the data, you associate the LUN# with the associated lines, as in: LOGICAL UNIT NUMBER 1563 LOGICAL UNIT NUMBER 1563 ~Default Owner: SP B LOGICAL UNIT NUMBER 1563 ~Current Owner: SP A LOGICAL UNIT NUMBER 1563 ~Device Map: Valid Then yo...
by RElliott63
23 Feb 2009 10:29
Forum: DOS Batch Forum
Topic: Automating FTP.
Replies: 2
Views: 5020

You could start with something like... Cls Set /P User=Enter UserID: Set /P Pwd=Enter Password: Echo Open xx.xx.xx.xx > %Temp%\FTPScript Echo User %User% %Pwd% >> %Temp%\FTPScript Echo CD \DestFolder >> %Temp%\FTPScript Echo LCD \SourceFolder >> %Temp%\FTPScript :GetAnotherFile Set /P SName=Enter SO...
by RElliott63
20 Feb 2009 13:40
Forum: DOS Batch Forum
Topic: FOR /R exclude ".svn" directory
Replies: 2
Views: 6158

Try this:


Code: Select all

 Dir * /aD/b/s |  Find /V ".SVN" > %Temp%\NewList
 For /F "Delims=" %%F In (%Temp%\NewList) Do (
   Echo File Name is : %%~nxF
 )



hth

-Rick
by RElliott63
20 Feb 2009 08:22
Forum: DOS Batch Forum
Topic: Retrieving filenames and inputting into another bat file?
Replies: 3
Views: 5935

You could try something like ... SETLOCAL ENABLEEXTENSIONS SETLOCAL ENABLEDELAYEDEXPANSION For /F "Delims=" %%F in ('Dir /B \MT32\Data\Database*.IB') Do ( Set "f=%%~nF" Call :BackupFiles !f! ) :BackupFiles "C:\Program Files\Borland\InterBase\bin\gbak" -B...
by RElliott63
20 Feb 2009 08:09
Forum: DOS Batch Forum
Topic: assign result of findstr to variable
Replies: 2
Views: 8202

Try something like: SETLOCAL ENABLEEXTENSIONS SETLOCAL ENABLEDELAYEDEXPANSION Find "ABC" Test.txt > %Temp%\ABCstrings For /F %%s in (%Temp%\ABCstrings) Do ( Set "Str=%%s:~-3% Call :DoSomethingWithString !Str! ) Del %Temp%\ABCstrings > Nul **Just a suggestions, hasn't b...
by RElliott63
18 Feb 2009 08:58
Forum: DOS Batch Forum
Topic: Help with Exception List
Replies: 1
Views: 3702

Just in case anyone is interested, this is the final script that works. For some reason, setting the "SkipPath" variable inside the Do-Loop in the ExceptPath Subroutine didn't do the assignment. -R Call :LogMsg B "Looking for Register Files at Reg# %1" For /F "Delims=" ...
by RElliott63
18 Feb 2009 08:47
Forum: DOS Batch Forum
Topic: Some MS-DOS Progs not working after hd put in new Compu
Replies: 3
Views: 5968

A "Root" folder is the "C:\". If you work from a DOS prompt, just type "CD \" and press <enter>. This is the ROOT folder. Look for a file named CONFIG.sys If it doesn't exist, it probably isn't your problem. But, if it existed on your older hard drive, it needs to be on...
by RElliott63
11 Feb 2009 15:17
Forum: DOS Batch Forum
Topic: Help with Exception List
Replies: 1
Views: 3702

Help with Exception List

I'm trying to secure delete files from a hard drive. I have the following but, I can't seem to find the glitch. The issue seems to be that the *SkipPath* variable isn't flagging properly coming out of the ExceptPath routine so that the RemoveFile routine knows whether to skip removing the file based...