Menu
  • HOME
  • TAGS

Open website url links with parameter by using a batch file

Tag: url,batch-file,parameters

I am trying to open some website url links with a parameter in my browser. I made a batch file using this code :

@echo off


start "images" "www.images.com/1000/image.jpg"
start "images" "www.images.com/1001/image.jpg"
start "images" "www.images.com/1002/image.jpg"
...
...
start "images" "www.images.com/5000/image.jpg"

All I want is to create a For loop that will do that :

For (i=1000; i<5000 ; i++)
{
     start "images" "www.images.com/i/image.jpg" 
}

where "i" is a parameter of the website link. I am new in the batch file creation and I cannot figure out how to make it work. I tried this one but it did not work:

for i in {1000..5000} 
do
start "images" "www.images.com/$i/image.jpg"

This question is a first step. Then i want to save the images shown on this links, only if the links are valid (not dead like in 403, 404 errors)

Best How To :

For /L %%i in (1000,1,5000) do (
     start "images" "www.images.com/%%i/image.jpg" 
)

bat file script to check if string contains other string

windows,batch-file,cmd

Substring operations are not available in for replaceable parameters. You need to assign the data to a variable and then execute the operation on this variable @echo off setlocal enableextensions disabledelayedexpansion >"tempFile" ( echo bob binson echo ted jones echo binson ) set "pattern=binson" for /f "usebackq delims=" %%a in...

Changing input path in Batch - path manipulating/modification

batch-file

@echo off setlocal enableextensions disabledelayedexpansion set "destinationRoute=d:\SVN\Project\Debug\General\Admin Project" for %%a in ("%destinationRoute%\..") do set "sourceRoot=%%~fa\ServicePortal\bin" echo %sourceRoot% Get a reference to the parent folder and append the needed elements....

Batch file rename output folder

batch-file

Read Variable Edit/Replace. For instance, to replace all . full stops with a minus sign (dash?) -, use set "slaveName=%%~nI" set "slaveName=!slaveName:.=-! set "OutputFolder=%BaseOutputFolder%_!slaveName!" ...

Batch file to check program installation

batch-file

You can try something like that : @echo off cls & color 0B Mode con cols=90 lines=5 set Location=%ProgramFiles%\Notepad++ set FileName=Notepad++.exe echo( & cls echo( & echo Please Wait for moment .... Searching for "%FileName%" on "%Location%" TimeOut /T 3 /NoBreak>Nul cls IF EXIST "%Location%\%FileName%" ( color 0A && echo...

If exist and errorlevels in a batch (.bat) file

windows,batch-file,command-line

Try this : REM if SqlCmd command is successful run the below if exist statement if "%ERRORLEVEL%"=="0" ( REM if the file exists then delete and exit: if exist "D:\Temp\database.bak" ( del "D:\Temp\database.bak" exit /B ) else ( REM if the file doesn't exist, exit with error code 1: echo...

Getting HTTP 302 when downloading file in Java using Apache Commons

java,file,url,apache-commons,fileutils

The code 302 refers to a relocation. The correct url will be transmitted in the location header. Your browser then fetches the file form there. See https://en.wikipedia.org/wiki/HTTP_302 Try https://repo1.maven.org/maven2/com/cedarsoftware/json-io/4.0.0/json-io-4.0.0.jar For FileUtils see How to use FileUtils IO correctly?...

Is there a way to output file size on disk in batch?

file,batch-file,filesize

Interesting question. I'm not aware of the size on disk value being a property of any scriptable object. You could calculate it by getting filesize modulo bytes-per-cluster, subtracting that modulo from the file size, then adding the cluster size. (Edit: or use Aacini's more efficient calculation, which I'm still trying...

Get Parameter from URL using PHP

php,url,redirect

You mean like this <?php session_start(); if(isset($_SESSION['postback'])) { if($_GET['postback'] == "") { header ("Location: qualify-step2.php?postback=".$_SESSION['postback']."&city=".$_SESSION['city']); } } ?>...

why i am not able to read Html Content from a website in a file?

java,url

if you are running from eclipse you have to pass the arguments. right click program - > run as - > run configurations -> arguments ->program arguments . in this tab pass the actual url which will be passed as args[0] to your main method....

Batch - Comparing two txt files

windows,batch-file,text,comparison

The code below keep lines from File2.txt from the first line that differ vs. File1.txt on: @echo off setlocal EnableDelayedExpansion rem Redirect the *larger* file as input < File2.txt ( rem Merge it with lines from shorter file for /F "delims=" %%a in (file1.txt) do ( rem Read the next...

C# mvc4 - direct URL to controller

c#,asp.net-mvc-4,url,redirect

You might have forgotten to specify name of the controller in Html.ActionLink() parameter. Try Html.ActionLink("actionname","controllername");

Batch ffmpeg and compress the files

batch-file,ffmpeg

Here is my suggestion for the batch code: @echo off setlocal EnableDelayedExpansion set "FolderBaseName=output_folder" set "BaseOutputFolder=%TEMP%\%FolderBaseName%" set "DropBoxFolder=%USERPROFILE%\documents\dropbox\megaSync" md "%DropBoxFolder%" 2>nul for %%I in (logo_*.png) do ( set "OutputFolder=%BaseOutputFolder%_%%~nI" md "!OutputFolder!" 2>nul for %%J in (*.mp4*) do ( ffmpeg.exe -i "%%~fJ" -i "%%~fI" -filter_complex overlay "!OutputFolder!\%%~nJ.mp4" ) %ProgramFiles%\WinRAR\Rar.exe a -cfg-...

String parsing with batch scripting

windows,string,parsing,batch-file,xml-parsing

This should work: @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION FOR /F "tokens=*" %%a in (pictures.xml) DO ( SET b=%%a SET b=!b:"=+! FOR /F "delims=+ tokens=2" %%c in ("!b!") DO ( ECHO %%c ) ) This will output only something.jpg. Here the expülanation: First we split the file into lines. Now we want...

Convert batch command to python

python,batch-file

You need to use the communicate method for the Popen objects you're creating. blah = Popen(...) blah.communicate() This will also block until it is finished, after which you can start the 2nd command....

As only show the words found in the findstr

batch-file,findstr

@echo off (for /F %%a in (List.txt) do ( Findstr /li /C:"%%a" "File.txt" > NUL if not errorlevel 1 echo %%a )) > "Result.TxT" ...

Create a bat file that will run git and then run script

git,batch-file

If you start an interactive shell (the -i option) it will not return until you exit the shell. To have commands run as part of your shell startup you then add them to the /etc/profile script. As you are dealing with the Git for Windows shell here that will be...

Batch script ends after for loop

windows,batch-file

In general, when a batch file invokes another one, the flow execution is transfered to the called batch and does not return to the caller. To allow the caller retrieve the execution flow, it is necessary to use the call command. for /l %%x in (1,1,120) do ( echo %%x...

Parsing the text file line-by-line using batch script (batch file)

windows,batch-file,scripting,cmd

you don't need to parse the file line by line. @echo off :START cls echo. set /p "cho=Enter a word: -> " findstr /i "\<%cho%\>" yourwords.txt >nul 2>&1 if %errorlevel%==0 ( echo. echo Sorry! that word is repeated word. echo. ) else ( echo. echo That is a new word....

htaccess rewrite rules conflict

php,.htaccess,url,mod-rewrite

Your issue is that the first rule matches, the last one can never get applied... RewriteEngine on RewriteRule ^gallery/([0-9]+)/?$ gallery.php?id=$1 [NC,L] RewriteRule ^([0-9a-zA-Z_-]+)/([0-9]+)$ products.php?cat=$1&id=$2 [NC,L] RewriteRule ^([^/]*)/([0-9a-zA-Z_-]+)/([0-9]+)$ product_categories.php?cat=$2&id=$3 [NC,L] RewriteRule ^(.*)/(.*)/([0-9a-zA-Z_-]+)/([0-9]+)$ product_details.php?cat=$3&id=$4 [NC,L] Rule of thumb: first the specific exceptions, then the more general rules. The NC flag does not...

What is the semantic HTML tag to display for URLs that are not links?

html,html5,url,tags,semantics

If I understand you correctly, you want the url to be a link but also display as a url. To do this put the url in the a tag twice, like so: This can then be style as desired by the destination page. <style> a { color: blue; text-decoration: underline;...

Execute a batch file before executing in a shortcut (.lnk)

windows,batch-file,lnk

Supply program with parameters to your batch script as follows C:\Siemens\NX10\UGII\setup_NX10_environment.bat "C:\Siemens\NX10\UGII\ugraf.exe" -nx and improve that batch as follows: rem all the original setup_NX10_environment.bat stuff here %* exit or rem all the original setup_NX10_environment.bat stuff here call %* exit or rem all the original setup_NX10_environment.bat stuff here start "" %*...

Rails less url path change

ruby-on-rails,ruby,url,path,less

You should use the font_url, and put the font in app/assets/fonts @font-face { font-family: 'SomeFont'; src: font_url("db92e416-da16-4ae2-a4c9-378dc24b7952.eot?#iefix"); //... } ...

How do i handle ERRORLEVEL 9 in cmd

batch-file,batch-processing

If you read the description of if command (available via if /?), you will realize that if errorlevel number command will execute the command when the errorlevel is greater or equal than the number. If you want to execute the command when the number is precisely a certain value, use...

String manipulation with batch scripting

windows,string,batch-file,space

your line set temp=%%c is the reason. There are spaces at the end. Use this syntax to avoid unintended spaces: set "temp=%%c" ...

Clean Urls with regular expression

regex,url,notepad++

Use the replace menu by pressing Ctrl+H, and make sure regular expressions are enabled. Then, Find (^.*\/).* and Replace $1: https://regex101.com/r/lJ4lF9/12 Alternatively, Find (?m)(^.*\/).* and Replace $1: https://regex101.com/r/lJ4lF9/13 Explanation: Within a capture group, Find the start of the string (^) followed by anything any number of times (.*) until the...

I cannot use the msg command in cmd (or batch for that matter). How can I fix this?

windows,batch-file

msg.exe is not available on all Windows platforms in all environments. There is just %SystemRoot%\Sysnative\msg.exe (64-bit), but no %SystemRoot%\SysWOW64\msg.exe (32-bit) on Windows 7 x64 Enterprise. Either the batch file is called with using explicitly %SystemRoot%\Sysnative\cmd.exe or inside the batch file %SystemRoot%\Sysnative\msg.exe is used on a Windows x64 machine while on...

String check incorrectly returning true

batch-file

You need to use quotes in your if-statements: :promotions_sucessful cls if "%division%"=="Bronze V" ( set league=Bronze IV set lp=0 echo You have been promoted! del promotion.txt pause>nul goto menu ) if "%division%"=="Bronze IV" ( set league=Bronze III set lp=0 echo You have been promoted! del promotion.txt pause>nul goto menu )...

Get special character from Query string in classic asp

url,asp-classic

I got where I am going wrong. while giving the redirection tag like <a href='ViewProfile.asp?mem_id=phani#1&page=1'> it should be like <a href='ViewProfile.asp?mem_id=Server.UrlEncode(phani#1)&page=1'> This solves the issue....

Batch file to open multiple instances of cmd and run Ruby script in each instance

ruby,windows,batch-file,cmd,watir-webdriver

Try next approach: pushd %USERPROFILE%\Desktop start "1" cmd /k ruby script_1.rb start "2" cmd /k ruby script_2.rb start "3" cmd /k ruby script_3.rb ...

Open website url links with parameter by using a batch file

url,batch-file,parameters

For /L %%i in (1000,1,5000) do ( start "images" "www.images.com/%%i/image.jpg" ) ...

Batch script terminates in case of error when using pipe operator

batch-file,error-handling,pipe

Delegate it to another cmd instance cmd /c" someoperation | someotheroperation " if errorlevel 1 ( handleerror ) ...

Win7 Batch File - Moving Subfolders(& Files) to Grand-Parent Directory

batch-file,cmd,merge,move,subdirectories

Challenge: accepted. Wouldn't it be nice if this functionality were built into robocopy, xcopy, fso.CopyFile, PowerShell's Move-Item, or any other utility or scripting object method? You probably ought to test this on a copy of the hierarchy. I did some minimal testing and it seemed to work as intended, but...

Format a command in powershell including a comma, can't find the right way to escape

powershell,batch-file,escaping,powershell-v2.0,comma

".\pacli DELETEUSER DESTUSER='"[email protected]`,com"' sessionid=333" You have double quotes in single quotes in double quotes, so the inner double quotes will terminate the string, so this will be parsed as three values: ".\pacli DELETEUSER DESTUSER='" [email protected]`,com "' sessionid=333" The answer is to escape, with a back tick (`), the inner...

Batch file %%i was unexpected at this time

variables,batch-file

If you are executing this directly in command prompt try this: for /f %i in ('wmic process where "name='chrome.exe'" get caption /format:value ^| find "chrome.exe" /c') do set var=%i for batch file left the double %...

Force WWW when URL contains path using .htaccess

.htaccess,session,url,redirect

It seems to look ok but one thing you should do is always put your other rules before the wordpress rules as a habit. When using wordpress it should generally be the last set of rules since it does all the routing. Now for the redirect, you should probably use...

Build urls with parameters

php,url

Your first array value is not a parameter. It's the URL you want to add the query string to. http_build_query() builds query strings, not entire URLs. So remove that value and then append the results of http_build_query() to it: $parameters =array( 'REQUEST_TYPE'=>'2', 'MID'=>'5' ); $url = 'https://pguat.paytm.com/oltp-­‐web/processTransaction?' . http_build_query($parameters); ...

Formating issue with md5deep

batch-file,hash,md5

From http://md5deep.sourceforge.net/md5deep.html: -q Quiet mode. File names are omitted from the output. Each hash is still followed by two spaces before the newline. ...

batch result me “echo off” instead the proper result

batch-file,cmd

You need to enable delayed expansion: tasklist /fi "imagename eq cmd.exe" /v | find /i /n "ARMASERVER" >NUL if "%errorlevel%"=="1" ( for /F "tokens=1-4 delims=:.," %%a in ("%time%") do ( set /A "ora=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100" ) echo percent inside ^(^)=%ora% setlocal enabledelayedexpansion echo exclamation=!ora! endlocal )...

Getting Respond Time from Ping Command

batch-file,ping

From command line: ==>ping -4 -n 1 google.com|findstr /i "TTL=" Reply from 173.194.112.105: bytes=32 time=17ms TTL=56 ==>for /F "tokens=7 delims== " %G in ('ping -4 -n 1 google.com^|findstr /i "TTL="') do @echo %G 17ms ==> Used in a batch: for /F "tokens=7 delims== " %%G in (' ping -4 -n...

What is Fragment URLs and why to use it

php,url,hash,fragment-identifier

A fragment is an internal page reference, sometimes called a named anchor. It usually appears at the end of a URL and begins with a hash (#) character followed by an identifier. It refers to a section within a web page. In HTML documents, the browser looks for an anchor...

How to show the place and only the words found Findstr?

batch-file,findstr

The solution below execute findstr command just one time per each word in List.txt file, so it should run faster. It also keep the results in "file" array for any further processing: @echo off setlocal EnableDelayedExpansion Set "LFiles=%temp%\Files\*.txt" for /F %%a in (List.txt) do ( for /F "delims=" %%b in...

Fastest way to count lines in a file

batch-file,dos

for /f "tokens=1 delims=:" %%# in ('find /c /v "" ^< FILENAME') do set "linescount=%%" echo %linescount% ...

Batch File Return Codes with executables

batch-file,exe

most executables (not all) do return a returncode. In batch, use %errorlevel% to reference it. (do it quite after the command, because other commands may overwrite it) Usually 0 means "Success/Errorfree". Non-zero values usually mean "Error/Failed" (there are no "standards", every executable may use it's own values for different errors,...

Garbage char returned by Shell.StdOut.ReadAll

batch-file,vbscript,stdout

The answer to your question is that cls is being captured by the StdOut stream and interpreted as an extended character. Get rid of it. You don't need it. Just so I feel like I've done something, here's the script rewritten as a batch + JScript hybrid. Save it with...

PHP - url path as parameters

php,url,parameters

There is a full guide to mod_rewrite here that looks pretty good. You have to scroll down a bit to get to url as parameters. https://www.branded3.com/blog/htaccess-mod_rewrite-ultimate-guide/ If you don't want to mess too much with mod_rewrite and already have everything directed through a single public index.php (which is a good...

Trying to pass variable in url

php,url

Use hidden type form's element named id: echo "<form action=\"/leaguemaster/fichaTorneio.php\">"; echo "<input type=\"hidden\" name=\"id\" value=\"$_GET[torneioid]\" />" Notice: I did not set the method attribute to the form because the GET method is the default method for HTML forms and it makes the form submits its values through the URL query...

Django: html without CSS and the right text

python,html,css,django,url

Are you using the {% load staticfiles %} in your templates?

Passing argument to python script within a batch file in Windows

python,batch-file

@echo off set "params=C:\params.txt" set "output=output.csv" for /f "usebackq tokens=* delims=" %%# in ("%params%") do ( python do_my_work.py %%# 1>>"%output%" ) ...

Htaccess rewrite URL with virtual directory and 2 variables

regex,apache,.htaccess,url,rewriting

ok , I assume you want to change the URI from http://www.example.com/result.php?team=arsenal&player=ospina to http://www.example/subdirectory/arsenal/ospina.html so this is the .htaccess that will do that for you RewriteEngine on RewriteCond %{QUERY_STRING} ^team=(.*)\&player=(.*)$ RewriteRule ^(.*)$ http://www.example.com/subdirectory/%1/%2.html [R=301] you can test it with htaccess tester here http://htaccess.madewithlove.be/ and some useful links for documentation and...