AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

BAT script

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
GreatKent



Joined: 05 Oct 2004
Posts: 20

PostPosted: Wed Mar 02, 2005 11:43 pm    Post subject: BAT script Reply with quote

Hi all,

is it possible to pass arguments into a BAT file? ie:
run.bat myfile.java
-------- run.bat -------------
javac myfile.java
java myfile
--------- end ---------
Thx!! Very Happy
Back to top
View user's profile Send private message
Gehn



Joined: 02 Mar 2005
Posts: 13
Location: Terminus of Tears

PostPosted: Thu Mar 03, 2005 12:00 am    Post subject: Reply with quote

Yes. %1 is the first argument, %2 is the second, and so on. I believe it goes up to %99. However, %0 isn't the number of arguments, like in AutoHotkey, it's the command that invoked the batch file (for instance, if the batch file is called foo.bat, then this would be 'foo' if you just typed foo to invoke it, or it'll be 'foo.bat' if you used its extension when you invoked it.)
_________________
The dumber people think you are, the more surprised they're going to be when you kill them.
Back to top
View user's profile Send private message Send e-mail AIM Address
Dave Campbell



Joined: 09 Jun 2005
Posts: 25
Location: Clearwater, Florida

PostPosted: Mon Jun 13, 2005 9:49 pm    Post subject: Batch file setup Reply with quote

Gehn wrote:
Yes. %1 is the first argument, %2 is the second, and so on. I believe it goes up to %99. However, %0 isn't the number of arguments, like in AutoHotkey, it's the command that invoked the batch file (for instance, if the batch file is called foo.bat, then this would be 'foo' if you just typed foo to invoke it, or it'll be 'foo.bat' if you used its extension when you invoked it.)


Hi Gehn,
I have a short script:
#X::filesettime 2020,D:\foo.xls,,1,0
That gives the file a modified date of 1-1-2020

I understand batch files and the substitution rule. I substituted the fully qualified file name with %1 and tried putting the ahk into the sendto but it doesn't honor it.

I would like to use this ahk syntax to changed the date on other files without having to type the file name into the ahk file each time.

Any advice on how I can achieve that?

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group