Hello can anyone tell me how I can start compass using a batch file?
cmd.exe /K "cd C:\Ruby200-x64\bin\ && C:"
compass watch "e:/project/html/"
But after it opens the correct location it does not start the line compass watch
Create a batch file (path\batchfile.bat) :
c:
cd C:\Ruby200-x64\bin\
compass watch "e:/project/html/"
Then execute :
cmd.exe /c "path\batchfile.bat"
Simple way which worked for me; have the batch file in the project folder with line:
compass watch
No need for changing paths if you move the project folder for example. For me it's convenient to just open the project folder and double click the file to start working.
Related
Unable to Execute The Bat file for building jar and copying into different location.
C:\apache-ant-1.9.15\bin\ant -f build.xml && COPY Source-Folder-Path Destination-Folder-Path /y
Its not building jar file. Can you pls rectify my script. I am using bat file to do this as its my regular task in project.
I got the answer and would like to post here for someone else, who got stuck here.
Write this script and put it near build.xml
Run the bat file in command line for repeat process.
C:\apache-ant-1.9.15\bin\ant compile jar && COPY D:\karshil-sheth\java.jar C:\my-Project\webapp\WEB-INF\lib /y
Script Explanation :-
It will find ant from location u installed or can write simple ant.
compile jar will create jar and put in the folder where u running the bat.
Also can write ant compile jar run this script and run, will get same output.
after && I am copying file from source to destination path as every time I change the code project will be executed from that jar.
/y is for overriding the last jar and pop up wont appear every time you run this script.
I am creating a script and I need to run exe file and a command at the same time. What am I doing wrong?
CD C:\Program Files (x86)\Jenkins\
START cmd.exe /T /C "jenkins.exe start"
The command line needs to be exactly as the following, otherwise it does not work:
C:\Program Files (x86)\Jenkins>jenkins.exe start
Thanks!
I don't quiet understand what you mean by saying you wan't to run an exe and a command at the same time. But if you wan't to start the jenkins.exe from your batch file, you can achieve this as follows:
cd "C:\Program Files (x86)\Jenkins\"
jenkins.exe start
alternatively, if you don't want the terminal to stay open as long as jenkins is running, you can use the following:
cd "C:\Program Files (x86)\Jenkins\"
start jenkins.exe start
When I start a batch file from another batch file, it just opens a new CMD window named just "TEST.bat", and doesn't run the actual batch. Running it manually works fine.
cd %~dp0\Colours\TEST.bat
start "TEST.bat"
I have tried many different ways to run the batch, but it all does the same thing. I've also tried to run the batch as administrator but same result again.
Full code(not finished): http://pastebin.com/GE8yJP0J
To run another batch file, use call not start. Also: cd expects a directory, not a filename.
cd "%~dp0\Colours"
call TEST.bat
how to run application which has .lnk extension with .bat script?
(I have an application and short of that is .lnk extension and want to run it using .bat)
error is that its not running
A file with .lnk extension is just a shortcut to a file.
To launch the executable that the shortcut targets to, just write the shortcut filename in the same way as you will do to run a executable file, as follows:
#Echo OFF
"C:\path yo tour shortcut.lnk"
Exit
Or also:
#Echo OFF
Start /Wait "" "C:\path yo tour shortcut.lnk"
Exit
I know I'm kinda late, but for anyone coming here:
If the shortcut is on the desktop, check whether it is on "your" desktop or on the public one - in batch you access the public one through %public%\Desktop
If you want to run multiple links, use this: start /b \your\path
dont forget the quotation marks if the path has spaces in it!
I want to write simple Batch file will click on the batch file
I should go to my directory path should be D:\DS\Install
At present i am doing every 1hr go to
RUN command and typing to cmd and connect to D:\DS\Install
Instead of this I want short cut option.. :-)
If I understand your question correctly,
You want a shortcut on desktop which will open a command prompt and change directory to D:\DS\Install
This is pretty straight forward:
Go to C:\windows\system32 and copy cmd.exe to D:\DS\Install folder
Now right click on the cmd.exe in D:\DS\Install folder and send it to desktop create shortcut.
You will have a shortcut on desktop which will take you to the required folder everytime..
Just FYI... cmd.exe will always open from the directory where it is placed.
Just create a shortcut in your desktop, and when asked for the location, type this command
cmd.exe /k "cd /d "d:\ds\install""
This shortcut will call cmd to execute the cd to change the drive/folder and keep the window open to continue working with it.
You can also make a batch file called ds.bat and put it in c:\windows or any other folder that is on the path.
You can then use the WIN+R hotkey and type ds and enter.
#echo off
cd /d "d:\ds\install"
cmd /k
#echo off
cd /d "d:\ds\install"
cmd /k