Search found 187 matches

by Fawers
28 Jun 2012 15:07
Forum: DOS Batch Forum
Topic: create an empty .txt file if the file doesnt exist
Replies: 9
Views: 8252

Re: create an empty .txt file if the file doesnt exist

>test.txt type nul will work just fine.
by Fawers
28 Jun 2012 12:04
Forum: DOS Batch Forum
Topic: Batch file to Create folder structure and move file types
Replies: 10
Views: 4719

Re: Batch file to Create folder structure and move file type

Don't hesitate to come back whenever you want, mate. :wink:

And there are many higher 'gods' than me on this forum. :p
by Fawers
28 Jun 2012 11:57
Forum: DOS Batch Forum
Topic: Batch file to Create folder structure and move file types
Replies: 10
Views: 4719

Re: Batch file to Create folder structure and move file type

My brain is able to process it normally. Hint: you can change the 2 last "texture" parts into 1. Try this: ::Texture PSD & PNG for %%t in (psd png) do if exist *.%%t move *.%%t "Texture\%%t" instead of ::Texture PSD - File types: .psd for %%t in (psd) do if exist *.%%t move *...
by Fawers
27 Jun 2012 10:24
Forum: DOS Batch Forum
Topic: How to format batch commands in posts to this forum?
Replies: 2
Views: 772

Re: How to format batch commands in posts to this forum?

Yes. Using the CODE marker will make your codes more readable here on the forum.

Code: Select all

[code]Your code here[/code]
by Fawers
26 Jun 2012 21:22
Forum: DOS Batch Forum
Topic: need help writing simple DOS batch file
Replies: 3
Views: 1229

Re: need help writing simple DOS batch file

mikecarter79 wrote:Fawers,

Thanks a million for the quick reply and code !!

:D

No problem! Come back whenever you want and/or need to.

PS: I might be wrong, but is the syntax you used to explain, the JavaScript syntax? :roll:
by Fawers
26 Jun 2012 18:39
Forum: DOS Batch Forum
Topic: need help writing simple DOS batch file
Replies: 3
Views: 1229

Re: need help writing simple DOS batch file

This should do it: @echo off :menu set "hdType=" set /p "hdType=Are you updating firmware on WD Hard Drive type 'A', 'B' or 'C'? " if /i "%hdType%" == "A" (start /wait WD_download.exe 1tb.bin&goto ok) if /i "%hdType%" == "B" (start /wai...
by Fawers
26 Jun 2012 17:13
Forum: DOS Batch Forum
Topic: Batch file awlays exit with o
Replies: 7
Views: 1532

Re: Batch file awlays exit with o

Could you copy-paste the contents of your text files? This wasn't supposed to happen, so I don't know what exactly you can/should do. Despite that, I'd like to test it myself.
by Fawers
26 Jun 2012 17:11
Forum: DOS Batch Forum
Topic: Batch file to Create folder structure and move file types
Replies: 10
Views: 4719

Re: Batch file to Create folder structure and move file type

Oh, silly me! It returns this error probably because there aren't any files of certain extensions. In "MoveFiles", replace current code with this: ::Animation - File types: .mma for %%t in (mma) do if exist *.%%t move *.%%t "Animation" ::Export - File types: .mmf for %%t in (mmf)...
by Fawers
26 Jun 2012 16:22
Forum: DOS Batch Forum
Topic: Batch file to Create folder structure and move file types
Replies: 10
Views: 4719

Re: Batch file to Create folder structure and move file type

I see. Writing a batch file from this info is possible. @echo off :: :MainCode for /f "delims=" %%a in ('dir /b /ad') do ( echo Processing folder: %%a ECHO pushd "%%a" call :MakeDirs call :MoveFiles ECHO popd echo, ) pause exit /b :MakeDirs for %%f in (animation export model sour...
by Fawers
26 Jun 2012 15:47
Forum: DOS Batch Forum
Topic: Batch file to Create folder structure and move file types
Replies: 10
Views: 4719

Re: Batch file to Create folder structure and move file type

Are .psd .png .obj . ma .mb all the extensions? In which folder each one of them must go, exactly ? Your request does make sense, but full information is required. 1) File Extensions (all of them) 2) Folder - File (which file extensions go to which folder) 3) Extra Info (you said, "Inside each ...
by Fawers
26 Jun 2012 13:38
Forum: DOS Batch Forum
Topic: Batch file awlays exit with o
Replies: 7
Views: 1532

Re: Batch file awlays exit with o

Try testing it within a child shell; what does it show?

Code: Select all

@echo off
if not defined call (
  set call=1
  call %0
) else (
  echo %errorlevel%
  pause
  exit
)
:main
fc start.txt a.txt

:End

exit /b %ERRORLEVEL%
by Fawers
25 Jun 2012 13:41
Forum: DOS Batch Forum
Topic: OFF TOPIC: How to add signature to my profile?
Replies: 3
Views: 1094

Re: OFF TOPIC: How to add signature to my profile?

Mm I've never had any interest upon the signature feature, so I can't help you out...
by Fawers
25 Jun 2012 13:39
Forum: DOS Batch Forum
Topic: .bat to copy files based on current date
Replies: 9
Views: 7202

Re: .bat to copy files based on current date

But what if a flag .txt file was created to be used with xcopy? I mean, the file is going to be replaced anyway.

Code: Select all

@echo off
if not exist C:\Test\test.txt (type nul>C:\Test\test.txt)
::remaining code
by Fawers
25 Jun 2012 09:46
Forum: DOS Batch Forum
Topic: Is it possible to break loop?
Replies: 31
Views: 24514

Re: Is it possible to break loop?

Another way to break a loop is to have a FOR CALLing a "label function". @echo off for /f "tokens=1,2" %%a in ('dir') do ( call :ToBreakOrNotTobreak "%%a" "%%b" ) :ToBreakOrNotToBreak if "%2" == "file(s)" (set /a "files=%1" ) else...
by Fawers
24 Jun 2012 16:51
Forum: DOS Batch Forum
Topic: USB DRIVER HELP!!! (SOLVED)
Replies: 13
Views: 2568

Re: USB DRIVER HELP!!!

Following aGerman's stream of thought, you could start your file like this: @echo off cd /d %~d0 set /a "pass=25 %% 13" :menu color 0A ::remaining code goes here I used the module operator (%) to define the password because it's harder for other people to read (at least it's what I think)....