After I set Compass to start watching a folder, what key(s) do I then hit to return to the command line? - compass-sass

After I set Compass to start watching a folder, what key(s) do I then hit to return to the command line? I'm using a Windows PC. Thanks.

Just spawn another command window...this one needs to stay up while the folder is being watched. Here's a good strategy for you :: run compass watch terminal command upon opening the folder with textmate

Related

Run as Administrator Bat File/ Cmd File Windows 10

I have the following cmd command:
C:\Users\spidey\AppData\Local\Programs\Python\Python39\python C:\Users\spidey\Documents\sleepScript\textdocument.py
Inside a .bat file. When I double click and run it, it runs well but when I try to right click and run as administrator it just opens the window and closes adruptly without completing the execution.
The end result of the command is a text file which is created in first case but not when I try to run it as administrator.
The reason for this to run as adminstrator is because I will be running it on cloud and so there it runs as administrator.
Here are the content of textdocument.py:
import datetime
file = open('read.txt', 'w')
file.write('Executed # ' + str(datetime.datetime.now()))
file.close()
Here is another update:
Tried to create a shortcut and setup it's advanced property as run as administrator. But that doesn't work as well.
After doing this, I tried to run the .bat file again as administrator but no effect.
As suggested in the comments, I shifted all the files to C: drive so that it's accesible to everyone. But unfortunately that didn't work as well window just opens and aprubtly closes without giving the end result. On the other hand normal running works here as well.
Here is the command:
C:\Python\Python39\python C:\uiPath\textdocument.py
After a long debugging, I realized that the command was actually running correctly. It's all that it was saving the file into the other default directory after adding in my python script:
os.chdir(path)
Where path is the path where I wanted it to store. Whereas in case of double clicking and running it, by default that path was set to the path where the file was located in.
The problem got fixed. Thank you everyone for the help!

How to run multiple commands (each from a new terminal) from a batch file in Windows

I've been using Ubuntu all my life, but today I've been given a different machine installed with Windows 10. I've an Angular project and I want to do the following things. All these in a separate terminal:
Navigate into project folder and run code . so that I can see the code on Visual studio.
Navigate into project folder and run ng serve to launch my application and keep it running.
Navigate into project folder and run node server.js to start backend server and keep it running.
this is very painful as the project location is-
C:\Users\tanzeel\Downloads\social-coder
Navigating again and again with a new terminal is what wasting my time. I decided to write a batch file so that I can do all at once with one single click. This is what my starter.bat file contains:
cd C:\Users\tanzeel\Downloads\social-coder\application 2>nul && call npm.cmd start
node C:\Users\tanzeel\Downloads\social-coder\server\server.js
code C:\Users\tanzeel\Downloads\social-coder
All of the above 3 commands works perfectly If I manually copy-paste them in separate terminals. But when I try to run them from batch file the problem is only first command is executed.I don't know other two are simply ignored or what. I'm coming from:
How to run multiple commands in a batch file?
How to run multiple commands in one batch file?
I admit that I'm a newbie and there are gaps in my knowledge. Please correct me.
You need to use e.g. START to spawn new processes, otherwise the currently running program will just block until it's finished. It looks to me that this is what you want:
#ECHO OFF
CD C:\Users\tanzeel\Downloads\social-coder
START code .
CD application
START npm start
CD ..\server
START node server.js
EXIT

need help in running a bat file but only after restart (log off/on not included)

i have a certain program that i want to run as windows boots up
but! i need it to be only after windows restart not log off and log on are out of the question - the system i have is running tests and and the app that i want to run is canceling those tests that`s why i need it to run only after windows restarts , so there is no chance that a tests would fail because of it
the .bat file points to the location of
tried shell:common startup but that open the .bat file even after i log off or log on
how do i do this ? i need this to be in a script/.bat file as well
You should add it here
C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
But cause you mentioned after only restart then you will need to run an background script to handle that restart
Or we may..
The common command to restart windows via .bat or cmd file is shutdown -r
So we can create
reboot.bat ,script.bat ,mover.bat > for example in 'C:\test' directory
reboot.bat
move script.bat "C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\script.bat"
shutdown -r
script.bat
: : stuff here..
C:\test\mover.bat
mover.bat
move "C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\script.bat" script.bat
now that we have our scripts let's add them to our Environment variables
From the desktop, right click the Computer icon.
Choose Properties from the context menu.
Click the Advanced system settings link.
Click Environment Variables.
In the section System Variables, find the PATH environment variable
and select it.
Click Edit then add ; following by C:\test Click Ok, Ok etc and
restart your cmd if opened
To answer your question just type reboot.bat or reboot in CMD command-line
Which when you want to run your script after restart you have to type this to cmd or just..make a restart.bat file with this command for just one click
I used stack overflow for android to answer this without test cause i'm not windows but i'm just familiar with plus didn't have my PC at this moment but i hope that answer is clear and understandable

Windows shortcut or batch file to open command prompt in ruby directory with a pre populated string

I have just started using Compass within Ruby on Windows. In order to watch a directory for changes, I need to run cmd.exe in the Ruby directory and then use the command "compass watch C:\path\to\project".
I wish to make a shortcut that will open cmd.exe in D:\ruby\bin\ (Ruby directory) with a pre-filled string that I can simply complete and then press enter to execute. For example:
C:\ruby\bin>compass watch D:\path\to\_
...and then I simply type the project folder name and press enter.
I can create a shortcut that runs cmd.exe in C:\ruby\bin\ but I then have to type the rest.
I can create a batch file that runs cmd.exe in its default location and then changes directory to C:\ruby\bin, then executes compass watch C:\path\to\project
I can't figure out how to pre-fill the above command and have cmd.exe wait for me to input the relevant project directory before manually pressing enter to execute.
It's a pretty simple one liner...
Open Notepad or other text editor
Change directory (cd) to your Ruby directory
Execute 'compass watch'
cd C:\ruby\bin
compass watch
Go to Save As
Change 'Save as type' to 'All files'
Save as compass.bat
Run the file (double-click) to start polling for changes
Source http://omnitech-support.blogspot.co.uk/2013/04/how-to-create-batch-files-for-windows-8.html
Create a new shortcut wherever you want to be able to run it.
For the command line enter cmd /K compass watch.
Call it whatever you like (I suggest 'Compass Watch') and save it.
Right click on it and choose properties.
Change the "Start In" to the folder where your config.rb is.
You can also set the "Run" option to Minimized.
Save the changes to the shortcut.
Run the shortcut to set Compass watching for changes in the relevant files in the folders defined in your config.rb.

Refresh node.js script!

I am running a script with node.js from the terminal (mac) and when I change my script I want to be able to rerun it without having to close and reopen terminal, Im a noob to mac and not sure how to do this?
Thanks
How are you starting Node? You should never have to close your terminal window. At the very least, you should be able to type ctrlC to stop it, then press the up arrow to bring the node command back from your command history, or type the command !!, which means “the last command line I ran”, and hit the return key.
Or, use node-dev. It automatically restarts node when files change in the same directory as your node script. You can install it with npm. Then, run node-dev instead of node:
node-dev script.js
This script is what I use. It works great!
There are several modules for this that you can install using npm, including:
nodemon
nolife
restartr

Resources