Search found 3974 matches

by Squashman
19 Feb 2019 11:37
Forum: DOS Batch Forum
Topic: was unexpected at this time
Replies: 3
Views: 835

Re: was unexpected at this time

Remove the spaces in the SET command for the JOBID variable. If you have a space on the left of the equals symbol it becomes part of the variable name. If you have a space on the right of the equals symbol it becomes part of the value.
by Squashman
18 Feb 2019 09:00
Forum: DOS Batch Forum
Topic: Unable to set correct parameters in for loop
Replies: 1
Views: 546

Re: Unable to set correct parameters in for loop

There is absolutely no need for the count2 variable. You can just use the FOR loop variable. Currently you are just assigning a string to the variable. I assume you want the value of the array variable. No need to assign it to another environmental variable either. Just use it directly in your next ...
by Squashman
17 Feb 2019 10:48
Forum: DOS Batch Forum
Topic: First read from file always fails
Replies: 3
Views: 802

Re: First read from file always fails

Environmental variables that are created and need to be referenced in a parentheses code block need to use delayed expansion.

Code: Select all

@echo off
setlocal enabledelayedexpansion
for /F %%A in (C:\Users\user1\Desktop\IP.txt) do (
	set F=%%A
	echo !F!
)
by Squashman
15 Feb 2019 14:42
Forum: DOS Batch Forum
Topic: Get notified when public facing IP changes
Replies: 9
Views: 1607

Re: Get notified when public facing IP changes

I wouldn't be hammering someone's website every minute. They will see that as abuse and try to block you.

Gonna assume you need a newer version of Powershell to run that cmdlet. Doesn't work on Powershell Version 2.
by Squashman
15 Feb 2019 13:58
Forum: DOS Batch Forum
Topic: Save/Load null variables
Replies: 3
Views: 761

Re: Save/Load null variables

Code: Select all

@echo off
set "variable=var1"
set "variable2="
set "variable3=var3"

(
echo.%variable%
echo.%variable2%
echo.%variable3%
)>save.sav

(
set /p variable=
set /p variable2=
set /p variable3=
)<save.sav

echo.%variable%
echo.%variable2%
echo.%variable3%

Pause
by Squashman
14 Feb 2019 22:18
Forum: DOS Batch Forum
Topic: Get notified when public facing IP changes
Replies: 9
Views: 1607

Re: Get notified when public facing IP changes

Why do you think you need an exchange server to do this?

You essentially have two options for the email. Use a third party command line client or use vbscript. That seems all you have left to do.
by Squashman
13 Feb 2019 22:50
Forum: DOS Batch Forum
Topic: Download and unzip file Batch
Replies: 34
Views: 4234

Re: Download and unzip file Batch

You asked for a program that was similar to apt-get and are now confused on how it works?
by Squashman
12 Feb 2019 10:20
Forum: DOS Batch Forum
Topic: Bat file to check a folder for TXT files with the associated PDF file
Replies: 5
Views: 943

Re: Bat file to check a folder for TXT files with the associated PDF file

You seem to be confused on how the IF command works. You seem to think you can do two IF functions within one IF command. If you need to do two separate functions of the IF command you will need to chain them together with multiple IF commands. But in my opinion you seem to be over complicating the ...
by Squashman
11 Feb 2019 10:48
Forum: DOS Batch Forum
Topic: Download and unzip file Batch
Replies: 34
Views: 4234

Re: Download and unzip file Batch

still get an error Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request." At line:4 char:17 + $wc.DownloadFile <<<< ($source, $dest) + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException I...
by Squashman
10 Feb 2019 16:25
Forum: DOS Batch Forum
Topic: Download and unzip file Batch
Replies: 34
Views: 4234

Re: Download and unzip file Batch

Bitsadmin also worked for me. C:\php>bitsadmin /transfer myDownloadJob /download /priority normal https://windows.php.net/downloads/releases/php-7.3.2-nts-Win32-VC15-x64.zip C:\php\php-7.3.2-nts-Win32-VC15-x64.zip DISPLAY: 'myDownloadJob' TYPE: DOWNLOAD STATE: TRANSFERRED PRIORITY: NORMAL FILES: 1 /...
by Squashman
10 Feb 2019 16:05
Forum: DOS Batch Forum
Topic: Download and unzip file Batch
Replies: 34
Views: 4234

Re: Download and unzip file Batch

switchy wrote:
10 Feb 2019 15:24
i have still that error
Care to share the execution and output with everyone?
by Squashman
10 Feb 2019 16:03
Forum: DOS Batch Forum
Topic: Merging CSVs with batch script but starting each on a NEW row
Replies: 4
Views: 864

Re: Merging CSVs with batch script but starting each on a NEW row

OK, that makes sense. (I'm downloading the files from a site that provides end-of-day stock price data files...so i don't have any say in what format they provide them in...) Never hurts to mention the problem to them. Is there some simple way I can amend the batch file I'm using to insert a carria...
by Squashman
10 Feb 2019 15:22
Forum: DOS Batch Forum
Topic: Download and unzip file Batch
Replies: 34
Views: 4234

Re: Download and unzip file Batch

ANother option would be using certutil for downloading: https://www.dostips.com/forum/viewtopic.php?f=3&t=8485 . penpen here is an error that is given by that utility: CertUtil: -URLCache command FAILED: 0x80072efd (WIN32: 12029) CertUtil: A connection with the server could not be established Works...
by Squashman
10 Feb 2019 14:56
Forum: DOS Batch Forum
Topic: Download and unzip file Batch
Replies: 34
Views: 4234

Re: Download and unzip file Batch

Default Windows permissions restrict you from writing directly to the root of the system drive. That has been in place since Windows Vista. So like well over 12 years already and is there possible to bypass it because php folder need to be in the system drive I never said or eluded to that you coul...