Search found 79 matches

by ChickenSoup
06 Dec 2011 07:33
Forum: DOS Batch Forum
Topic: How to view hidden folders in dos?
Replies: 3
Views: 4784

Re: How to view hidden folders in dos?

Try looking at "dir /?"
or what you are looking for is :

Code: Select all

dir /adh /b /s
by ChickenSoup
05 Dec 2011 14:58
Forum: DOS Batch Forum
Topic: Batch to delete specific files & folders
Replies: 4
Views: 5531

Re: Batch to delete specific files & folders

I'm no expert but, in the batch file you could use something like this possibly: for /f "tokens=*" %%a in ('dir /ad /b /s ^|findstr /e /i /r "\\Debug\>"') do rd /s /q %%a for /f "tokens=*" %%a in ('dir /ad /b /s ^|findstr /e /i /r "\\Release\>"') do rd /s /q %...
by ChickenSoup
18 Mar 2011 11:12
Forum: DOS Batch Forum
Topic: remove warning message
Replies: 2
Views: 3778

Re: remove warning message

Can't really help without knowing how the warning pops up. And don't know how wamp runs.
by ChickenSoup
18 Mar 2011 11:10
Forum: DOS Batch Forum
Topic: Multiple checks in IF
Replies: 2
Views: 3921

Re: Multiple checks in IF

I think you would need multiple IF statements. You can eliminate case by using /I. But, a for loop like this can help clean it up.

Code: Select all

for %%a in (s n 10) do IF /I "%%a"=="%var1%" (do X) ELSE (do Y)


hope this helps get you on the right track
by ChickenSoup
18 Mar 2011 10:58
Forum: DOS Batch Forum
Topic: Replacing a string with timestamp
Replies: 5
Views: 7129

Re: Replacing a string with timestamp

Well, in batch this can get you a timestamp. Not sure if this helps:

Code: Select all

echo %date:~-4%%date:~-7,2%%date:~-10,2%%time:~0,2%%time:~3,2%
by ChickenSoup
18 Mar 2011 10:31
Forum: DOS Batch Forum
Topic: setting variable within for loop
Replies: 1
Views: 3485

Re: setting variable within for loop

Didn't really look too closely but, try this:

Code: Select all

@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
for /f "tokens=* delims=" %%X in ('dir /ad /b') do (
for /f "tokens=3 delims=_" %%A IN ("%%X") do (
echo %%A
set version=%%A
echo !version!
)
by ChickenSoup
08 Feb 2011 11:07
Forum: DOS Batch Forum
Topic: Parse or string minipulating after last "\"
Replies: 6
Views: 7269

Re: Parse or string minipulating after last "\"

Very similar item discussed in this thread: http://www.dostips.com/forum/viewtopic.php?f=3&t=1619

Code: Select all

for %%a in ("%temp2:\=" "%") do @set folder2=%%~a
echo.%folder2%
by ChickenSoup
08 Feb 2011 10:01
Forum: DOS Batch Forum
Topic: insert text to rename files
Replies: 2
Views: 4640

Re: insert text to rename files

Could you give a bit of a sample set of the files, the folder structure they are in, and how you would want them to look / be named? I'm not sure which way to go and am not sure on the exact source. Tip: "dir /b /s" of the directory in question will give a structure of the folders and files.
by ChickenSoup
01 Feb 2011 09:14
Forum: DOS Batch Forum
Topic: Travers PATH variable
Replies: 7
Views: 7908

Re: Travers PATH variable

aGerman wrote:This would work for me as well:

Code:
@echo off &setlocal
for %%a in ("%path:;=" "%") do echo %%~a
pause

I yeild to the master of batch. :wink:
by ChickenSoup
01 Feb 2011 09:00
Forum: DOS Batch Forum
Topic: Travers PATH variable
Replies: 7
Views: 7908

Re: Travers PATH variable

Try this: @echo off set pathvar=%path% set searchfile=cmd.exe :pathloop for /f "tokens=1* delims=;" %%a in ("%pathvar%") do ( echo Searching for %searchfile% in: %%a dir /b "%%a" 2>nul|findstr /i /r "\<%searchfile%\>">nul && echo.%searchfile% Found in ...
by ChickenSoup
31 Jan 2011 10:09
Forum: DOS Batch Forum
Topic: needs to create incremental synch local folder with ftp
Replies: 10
Views: 11791

Re: needs to create incremental synch local folder with ftp

You probably need it in passive mode. Try changing 'open' line to:

Code: Select all

open login:pass@194.154.80.6:21 -passive
by ChickenSoup
31 Jan 2011 08:10
Forum: DOS Batch Forum
Topic: needs to create incremental synch local folder with ftp
Replies: 10
Views: 11791

Re: needs to create incremental synch local folder with ftp

Once you have your script written you would have to use windows task scheduler to run it in the background or some other task scheduler. So you would create a task that launches winscp like so: winscp.exe /console /script=yourscript.txt yourscript.txt (untested) option batch on option confirm off op...
by ChickenSoup
31 Jan 2011 07:57
Forum: DOS Batch Forum
Topic: move file to a shared folder in windows 7
Replies: 3
Views: 4729

Re: move file to a shared folder in windows 7

In windows if you move a file to a different directory on the same drive, it will keep its NTFS permissions from where it was. If you copy the file, it inherits the permissions. Also, if you move a file to a different Windows drive (partition) or to a network drive, it actually copies the file and t...
by ChickenSoup
28 Jan 2011 15:25
Forum: DOS Batch Forum
Topic: string manipulation help
Replies: 30
Views: 32977

Re: string manipulation help

I'll give an example set for the dir /ad /b /s | findstr /i /c:"%buildPatch%" | FINDSTR /i /c:"%choice%": Directories to search (result of 'dir /ad /b /s'): C:\sandbox\count C:\sandbox\New C:\sandbox\other C:\sandbox\patches C:\sandbox\Versions C:\sandbox\Versions\1.05 C:\sandbox...
by ChickenSoup
28 Jan 2011 15:17
Forum: DOS Batch Forum
Topic: string manipulation help
Replies: 30
Views: 32977

Re: string manipulation help

:SEARCH set /p buildPatch=Enter the build and patch level: set /p choice=Enter the search word or phrase to find the QF: setLocal EnableDelayedExpansion for /f "tokens=* delims= " %%a in ('dir /ad /b /s | findstr "%buildPatch%" | FINDSTR /s /i /L /M /c:"%choice%" *.txt...