473,385 Members | 1,333 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

call batch file with arguments

93 64KB
Hey dudes! source code:

Expand|Select|Wrap|Line Numbers
  1. @echo off
  2. color 0a
  3.  
  4. set /p ip=Enter the ip you want to ping:
  5. set dataSize=10000
  6. goto loop
  7.  
  8. :loop
  9.     ping %ip% -n 1 -w 1 -l %dataSize%
  10.     set dataSize=dataSize+dataSize
  11.     pause
  12.     start cmd /c ping.bat "%ip%" <---------- parameter
  13.     goto loop
  14.  
  15.  
  16.  
  17.  
I want to know if there is a way to start a batch file with an arguments, in this case so I don't have to write thei for EVERY window that starts.

Any help would be awsome XD
Apr 8 '15 #1
2 3350
Luuk
1,047 Expert 1GB
hi dude..

if you have a file like this, with name 'test.bat':
Expand|Select|Wrap|Line Numbers
  1. @echo off
  2. echo Hi %1
  3.  
when you type 'test Dude' on the command prompt,
it will answer with 'Hi Dude'

Or, like this
Expand|Select|Wrap|Line Numbers
  1. @echo off
  2.  
  3. set ip=%1
  4. if not "%ip%"=="" goto :skipquestion
  5. set /p ip= Enter the ip you want to ping:
  6.  
  7. :skipquestion
  8. echo You entered ip: %ip%
  9.  
Apr 8 '15 #2
Xillez
93 64KB
thank you so much man. XD
Apr 10 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: code_wrong | last post by:
Hi, I'm reading this: http://www.catch22.net/tuts/selfdel.asp (Self Deleting Executables) and playing around with the batch file method .. trouble is I always get a command box at the end with...
0
by: Leo Heska | last post by:
Hi I haven't seen the following problem mentioned anywhere We have an application written in VB.NET which executes a batch file (named startJob.cmd). We have discovered that if that batch file...
1
by: Bright | last post by:
Hi All, I want to execute a .bat file and get the output from console using C# in a window application, the .bat file includes the java classpath and other environment setting, can anyone know...
1
by: Kannan.V [MCSD.net] | last post by:
hi, I have this situation here, I need to call a VB application (which i can code), which does some calculations on some dates and returns a date value. For simplicity lets say, i pass a date to...
13
by: MLH | last post by:
I have a batch file named GetConf.bat. It contains a line like this: ipconfig /all >c:\MyAppDir\IPdata.txt I believe I could run the line with something like ShellWait by Terry Kreft. Any...
1
by: steve | last post by:
Hi all, Here's some work in progress that should allow you to run a batch file as a custom action in a VS deployment project. Yup I know you can use js or wsh, but the target may not have...
6
by: eric.goforth | last post by:
Hello, I have a simple batch file that I'm trying to call from a VB.NET application: @ECHO OFF IF (%1)==() GOTO END DIR %1 > MYDIR.TXT :END @ECHO ON
0
by: Elroyskimms | last post by:
I need to execute a batch file via ASP.Net. In my VB.Net code, I'm using System.Diagnostics.Process to call the batch file and its appropriate command line arguments. I'm using...
0
by: RadhakrishnanR | last post by:
Hi, I have created batch file (plz see bellow). This batch file copy the text file from FTP server. I have bellow query: 1. This bellow batch file how to call from VB6.0 application (Not in .Net...
14
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In my windows applicationm, i need to excute a batch file. this batch file throws some text and questions to the screen, i need to catch the standard Output, check if it's a question, in...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.