Search found 237 matches

by DosItHelp
10 May 2010 19:31
Forum: DOS Batch Forum
Topic: analysis: ":: is not the same as rem"
Replies: 6
Views: 11916

Re: analysis: ":: is not the same as rem"

Interesting jep!

dostips should have a section for "interesting behaviors".
Another thing about rem is the effect of the dot:

Code: Select all

rem &echo this line will not be printed
rem.&echo this line will be printed
by DosItHelp
18 Apr 2010 22:17
Forum: DOS Batch Forum
Topic: Batch files and online resources...
Replies: 1
Views: 3813

Re: Batch files and online resources...

Hi phillid, I wanted same for dostips.com and investigated. From what I learned - if your hosing provider supports webdav then you can provide file access like "\\live.sysinternals.com\tools\pslist.exe" and execute this from a command line or from within a batch. I haven't figured out yet ...
by DosItHelp
18 Apr 2010 21:48
Forum: DOS Batch Forum
Topic: Help
Replies: 8
Views: 9012

Re: Help

The brackets are not balanced, a closing bracket missing somewhere near the end. Another thing I noticed is that the "If %R%==%RS%" condition will never be true because R will will be 0<R<1000, but never 1000, because "%random% %% 999" will return a random number 0<=number<999. D...
by DosItHelp
06 Apr 2010 21:39
Forum: DOS Batch Forum
Topic: Solution: to write multiple times on the same line
Replies: 2
Views: 4903

Re: How to write multiple times on the same line

Very interesting Jan - thanks for sharing this!

This line executed at the command line creates the text file with the 'CR CR' in it in the current directory.

Code: Select all

(echo.N cr.txt&echo.e 100 0d 0d&echo.r cx&echo.02&echo.w 100&echo.q)|debug>NUL
by DosItHelp
18 Feb 2010 20:32
Forum: DOS Batch Forum
Topic: Given Specific Path: Determine Short or Long path equivalent
Replies: 1
Views: 3764

Re: Given Specific Path: Determine Short or Long path equivalent

Hi Jeff, you could post an example of the path you start with and what you would like it to be converted to. May be then I or someone else can help you.
by DosItHelp
14 Feb 2010 00:57
Forum: DOS Batch Forum
Topic: Only Download Fully Uplaoded files from FTP
Replies: 3
Views: 5188

Re: Only Download Fully Uplaoded files from FTP

Egulk, I don't know how to check if a files is done uploading. Here an alternative that may work for you: Have the upload script upload the files into a different folder. When done uploading have same upload script move the file over to the target folder with a single FTP "rename" command....
by DosItHelp
06 Feb 2010 02:19
Forum: DOS Batch Forum
Topic: Saving input from batch into text file [Partially complete]
Replies: 2
Views: 4234

Re: Saving input from batch into text file [Partially complete]

bre, You will need to escape special characters like this: @echo AutoNetwork ^<BNS_VPN^> >> test.txt Optionally use FOR command like this: (for %%A in ( "ComputerName %ComputerN" "AutoNetwork <BNS_VPN>" "AutoPassword <password>" "ChatColorLogBack 000000" "...
by DosItHelp
06 Feb 2010 02:12
Forum: DOS Batch Forum
Topic: Batch File Determine Computer Name
Replies: 2
Views: 4197

Re: Batch File Determine Computer Name

Try
echo %COMPUTERNAME%
by DosItHelp
04 Feb 2010 22:10
Forum: DOS Batch Forum
Topic: FTP Upload only different file
Replies: 2
Views: 4156

Re: FTP Upload only different file

sax, Try this. I have done some testing. It also works for files with spaces in it. Replace the section "Extract Ftp Script to download files..." with this: REM -- Extract Ftp Script to upload files that don't exist in remote folder Set "FtpCommand=mput" For %%A In (%FileList%) D...
by DosItHelp
18 Jan 2010 21:16
Forum: DOS Batch Forum
Topic: strLen Subroutine in Windows 2000 doesn't work
Replies: 7
Views: 9155

Well not sure whats going on. Below an alternative implementation you can try. @echo off set "str=This string is 33 characters long" call:strlen str pause&goto:eof :strLen string len -- returns the length of a string via binary search, maximum length 1023 :: -- string [in] - variable n...
by DosItHelp
16 Jan 2010 01:07
Forum: DOS Batch Forum
Topic: Math Help
Replies: 2
Views: 4629

Hey The Great One, I simplified your batch a little and added the percentage-correct at the end. @echo off set /a right=0, wrong=0 echo 1: Take Test echo 2: Exit set /p userinp=choose a number(1-2): set userinp=%userinp:~0,1% if "%userinp%"=="2" GOTO:EOF cls echo What is ...
by DosItHelp
16 Jan 2010 00:11
Forum: DOS Batch Forum
Topic: Replace one word with multiple words w/ BatchSubstitute.bat?
Replies: 1
Views: 3784

sj10, There is actually a bug in the batch file. To fix this replace the IF statement in the batch script from: if "%*"=="" findstr "^::" "%~f0"&GOTO:EOF to: if "%~1"=="" findstr "^::" "%~f0"&GOTO:EOF Let me know...
by DosItHelp
25 Dec 2009 23:11
Forum: DOS Batch Forum
Topic: Octal Decimal and Leading Zeros
Replies: 5
Views: 10806

robbot, To process a number with up to 3 digits in the "set /a" command and avoid problems with leading zeros, simply prefix the number with 1000 during assignment and use modulo arithmetic to remove the added value, e.g.: set numstr=002 set /a num=1000%numstr% %% 1000 rem now num equals 2...
by DosItHelp
22 Dec 2009 23:28
Forum: DOS Batch Forum
Topic: Problem with BatchSubstitute.bat
Replies: 12
Views: 69774

Good point ghostmachine4. To make it transparent to batch users here a batch function that creates the vb script on the fly and uses it. @echo off ::BatchSubstitude - parses a File line by line and replaces a substring" ::syntax: BatchSubstitude.bat OldStr NewStr File :: OldStr [in] - string to...
by DosItHelp
22 Dec 2009 01:05
Forum: DOS Batch Forum
Topic: A command line digital radio solution
Replies: 1
Views: 3977

mikehirst - very nice the way you made use of the menu loop presented at DosTips. :D

I think you can remove the "cmd /c " in front of each call, the start command should take care of everything.