Search found 1804 matches

by penpen
08 Jul 2020 17:04
Forum: DOS Batch Forum
Topic: Figuring out which computer is being used at two different locations
Replies: 8
Views: 120

Re: Figuring out which computer is being used at two different locations

What information am I going to retrieve and store? Since the two PCs are identical how do I know which is which? (First don't throw away your old resetup scripts.) Just boot the pc you want to resetup next. Then execute the "resetup.bat" (by doubleclicking that file on your USB drive) which somehow...
by penpen
08 Jul 2020 03:53
Forum: DOS Batch Forum
Topic: Figuring out which computer is being used at two different locations
Replies: 8
Views: 120

Re: Figuring out which computer is being used at two different locations

I think you might not be understanding what this script is for. But maybe i did understand what the script is for; contrary i think it's hard to imagine another usefull usage for such a script. It seems you obviously never thought of pushing the setup while the old system is running, so you didn't ...
by penpen
07 Jul 2020 07:28
Forum: DOS Batch Forum
Topic: Figuring out which computer is being used at two different locations
Replies: 8
Views: 120

Re: Figuring out which computer is being used at two different locations

The PC name is the default DESKTOP-XXXXXXX random Windows one, so %USERDOMAIN% is out Unless you change that value every time you reboot your pcs, then i don't see, why it should be "out". In case you change that value every time you reboot your pcs, then just don't change that value on reboot. pen...
by penpen
17 Jun 2020 12:01
Forum: DOS Batch Forum
Topic: jscript issues with downloading a zip from the Web
Replies: 5
Views: 589

Re: jscript issues with downloading a zip from the Web

You misunderstood what i wrote above: I didn't ask you to change the program code to get more info about that error (if that is what you might mean with "When I echo the error". I simply don't know, what you see on your screen. That program has multiple "WScript.ECHO"-statements. Once it reaches the...
by penpen
15 Jun 2020 03:37
Forum: DOS Batch Forum
Topic: Executing dynamic code blocks
Replies: 1
Views: 306

Re: Executing dynamic code blocks

This might help you (untested):

Code: Select all

	set "e=^^^!"
	set "cnt=0"
	set quot=^"

	call :myloop "for /F !quot!!param!!quot! %%%%G in (%~nx0) do (echo(#%%%%G && set /a cnt=cnt+1 >nul && if %%e%%cnt%%e%%==2 (exit /b) )"

penpen
by penpen
15 Jun 2020 02:51
Forum: DOS Batch Forum
Topic: jscript issues with downloading a zip from the Web
Replies: 5
Views: 589

Re: jscript issues with downloading a zip from the Web

I don't see the error you get, so could you copy paste or describe that?


penpen
by penpen
15 Jun 2020 02:37
Forum: DOS Batch Forum
Topic: Batch delete first 67 character all text file in folder
Replies: 2
Views: 407

Re: Batch delete first 67 character all text file in folder

You might want to use only one file per loop and add an outer loop (to not mix up files). This might help you (but is untested): @echo off & setlocal enabledelayedexpansion set "txt=*.txt" :: the following line will delete the content of "Result.txt", if you don't want that delete it >"Result.txt" r...
by penpen
06 Jun 2020 13:18
Forum: DOS Batch Forum
Topic: Queue Script
Replies: 1
Views: 398

Re: Queue Script

This might help you (untested): @echo off setlocal enableExtensions disableDelayedExpansion for /l %%a in (1, 1, 10) do ( call :createAnnn.txt "%%~a" call :printAnnn.txt "%%~a" ) :createAnnn.txt set "COUNTER=000%~1" set "COUNTER=%COUNTER:~-3%" >"A%COUNTER%.txt" ( echo(%date% echo(%time% echo(Your nu...
by penpen
06 Jun 2020 12:48
Forum: DOS Batch Forum
Topic: jscript issues with downloading a zip from the Web
Replies: 5
Views: 589

Re: jscript issues with downloading a zip from the Web

When checking the webpage, it seems that they are still using the same class names and (most of the) internal structure but inserted an "<tr></tr>". So you should update the number behind the selected "tr"-object (untested): Change the "getElementsByTagName('tr')[2]" part to "getElementsByTagName('t...
by penpen
03 Jun 2020 15:02
Forum: DOS Batch Forum
Topic: for loop -> Pipe - not working
Replies: 2
Views: 453

Re: for loop -> Pipe - not working

I think you meant to use (untested): FOR %%A IN ( "StartMonth" ) DO ( FOR /F "tokens=2 delims==" %%a IN ('type Z:\TEMP\variablefile.txt ^| FIND "%%~A"') DO ( echo %%a ) ) But you could also use the find-command with a filename (untested): FOR %%A IN ( "StartMonth" ) DO ( FOR /F "tokens=2 delims==" %...
by penpen
03 Jun 2020 14:56
Forum: DOS Batch Forum
Topic: Telnet Scripting Tool v.1.0 by Albert Yale
Replies: 11
Views: 902

Re: Telnet Scripting Tool v.1.0 by Albert Yale

You seem to wait for different strings, when reaching the same menue (or do i missinterpret what i see?): "sm 60715 60714" versus "Entrez une requete comme celles-ci (entrer b pour finir):". I am not familiar with the Telnet Scripting Tool, but maybe your second wait doesn't work, because it doesn't...
by penpen
27 May 2020 01:43
Forum: DOS Batch Forum
Topic: Copy files do not overwrite existing
Replies: 11
Views: 14288

Re: Copy files do not overwrite existing

Using wildcards also seems to work fine: Z:\>del *.hta *.tmp Z:\>>>"test.hta" echo( Z:\>>>"test2.hta" echo( Z:\>>>"test3.hta" echo( Z:\>echo dndndn|xcopy /-y /d *.hta *.tmp Z:test.hta Z:test2.hta Z:test3.hta 3 Datei(en) kopiert Z:\>echo dndndn|xcopy /-y /d *.hta *.tmp 0 Datei(en) kopiert Z:\>>>"test...
by penpen
25 May 2020 01:31
Forum: DOS Batch Forum
Topic: Copy files do not overwrite existing
Replies: 11
Views: 14288

Re: Copy files do not overwrite existing

That command works on my (actual) win10, but i noticed another nitpick, if the target does not exist xcopy asks if it should create a directory or file (so i added a 'd'); also it is localized (which might cause isues): Z:\>>>"test.hta" echo( Z:\>echo dn|xcopy /-y /d test.hta test2.hta Ist das Ziel ...
by penpen
23 May 2020 05:17
Forum: DOS Batch Forum
Topic: Self Updating Continuously Running Batch
Replies: 7
Views: 776

Re: Self Updating Continuously Running Batch

This is obvious since the file does get changed when it is saved. If you overwrite your batch file, then the file pointer of the running file doesn't change. So if your new file has a valid command at that fileposition, then it will run without issues (except that the resulting algorithm may not be...
by penpen
20 May 2020 04:38
Forum: DOS Batch Forum
Topic: best way to encrypt passwords in cmd files?
Replies: 9
Views: 3368

Re: best way to encrypt passwords in cmd files?

If that#s your only issue, then you could do that (if i don't error) by using delayed expansion when usefull and not using it when harmfull; example: @echo off setlocal enableExtensions disableDelayedExpansion set "line=" for /f "usebackq tokens=* delims=" %%a in ("%~f0") do ( set "line=%%~a" setloc...