| 1. |
Solve : cant compline the program using batch file? |
|
Answer» hi friends, by the way....if we use tcc file.c directly then what the matter? For this to work the tcc program needs to be in the current directory or on the path. It might be wise to use a path to the compiler and run your batch from the same directory where the SOURCE is located. This way you won't be tied to the directory where the compiler lives. The compiler will automatically search the lib and include directories, so unless you have header files or defs in other directories there is no need to use the switches. Code: [Select]echo off c:\tc\bin\tcc %1 For a second PARAMETER you can use the reference %2 in your batch file. The Tiny C Compiler uses mostly switches, what do plan on passing as the second parameter? Happy coding. Quote from: Sidewinder on July 01, 2008, 11:31:42 AM
'cause i want to make a batch file that shut down my system after a desired duration. i used this shutdown.bat Code: [Select] echo off shutdown -s -f -m [computer name] %1 %2 and used following command shutdown.bat -t "120" but this make system restart(not shutdown) immediately. beside, if i use the following then i get error. Code: [Select] echo off shutdown -s -f -m [computer name] -t %1 shutdown.bat "120" please someone check this out and solve the problem Quote from: san_crazy on July 03, 2008, 11:27:24 AM please someone check this out and solve the problem And fix global warming and cure poverty and get me a pay rise. san_crazy, wait your turn! Quote from: Dias de verano on July 03, 2008, 11:35:28 AM And fix global warming and cure poverty and get me a pay rise. i think you are the right person who can fix this problem, aren't u? Quote And fix global warming and cure poverty and get me a pay rise. If only. san_crazy, does this have anything to do with the compiler script earlier in this thread. You asked about a second parameter, and now you've gone off and changed the topic. In the future it might be better for everybody's sanity if you started a NEW thread when you change topics. You don't need the -m switch unless you're shutting down a remote machine on the network. Code: [Select]shutdown -t %1 -f -s Run from the command prompt as batchfilename 120 Do not name your batch file shutdown, otherwise you'll run the MS command instead of your batch file. Quote from: Sidewinder on July 03, 2008, 11:51:42 AM
Nice catch, SW. (Are you named after the snake or the missile?) Quote from: Sidewinder on July 03, 2008, 11:51:42 AM
I'm sorry, I'll not repeat it again Quote
thanks anyway |
|