Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Batch file needed to pass on arguments.
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
I Smell Death




PostPosted: Tue Apr 22, 2008 8:15 pm   Post subject: Batch file needed to pass on arguments.

I am in need of the text that i would put in a batch file as turing does not seem to be getting the arguments.

Here's what i did. i went in to the command line and typed the following

assoc .abcde=TestAssociation
ftype TestAssociation=C:\1.exe %1

with 1.exe being the compiled version of my program.
When i double clicked a file with the .abcde extension it ran the program but the program reported 0 arguments being passed to it.
So i decided that i would work around the problem. (after spending hours in the registry making sure every thing was right)

Now i just want the test for a batch file to do the following.

I need a batch file that when started by a data file it saves that data files name in a differnt file for example when i double click on 1.abcde it would run a.bat which then saves the the C:/...1.abcde (the full file name and location) in a file z.txt

it should be simple but when i tried the most i could get was to save the location of the .abcde file and not it's name.

sofar i have spent about 6-8 hours on this problem.

Edit:
So some people have been helping me but we can't seem to get past here.

@echo OFF
echo %1>>z.txt

it will output the location of the file until it encounters a space so a location that like this
C:\Documents and Settings\1.abcde

would be output like this
C:\Documents

Thanks
ISD
Sponsor
Sponsor
Sponsor
sponsor
I Smell Death




PostPosted: Wed Apr 23, 2008 9:58 am   Post subject: RE:Batch file needed to pass on arguments.

I've resolved the issue.
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: