How to run registered exe in certain folder using Windows CLI (batch) - windows

I have a vagrant installed and I want to create batch file which will run in from certain directory.
How can I do it?
Normally I do:
d:
cd vagrant
vagrant up
I would like to have something like:
d:\vagrant\vagrant up
But it does not work, as it says that name is not recognized

Related

Installing Github .zip files on Chromebook via Linux

I'm using a Linux Debian terminal, trying to install a Github .zip file by following a walkthrough (from Chromebook). They're using a Windows terminal and access the zip file from a G: drive. They run the following:
C:\Users\zasur>G:
G:\>cd filename.zip
G:\filename>npm install
Which installs the Github zip. I've looked all over online and tried a few different solutions but can't get past the second command they run.
I was able to open /mnt/chromeos/MyFiles/Downloads from Linux by sharing the Downloads folder with it.
I'm not sure how to change the directory from here to the filename.zip and/or run commands from it. Whenever I try to run cd filename.zip or cd /mnt/chromeos/MyFiles/Downloads/filename.zip it always fails. Is this even possible on a Chromebook?

What is the proper way to insert a variable into a file path in BASH?

I am working on my first script and it has been going well aside from one thing. The script is meant to be a simple script to install a software on Ubuntu devices for work. The main problem I am running into is the path the package is downloaded to is /home/(the user)/Linux_Test (custom file I have in github). Since this is suppose to run on multiple machines I am trying to make the user part of the path a variable. Currently I have
# Install the Agent.
sudo dpkg -i "/home/$USERNAME/Linux_Test/'SentinelAgent_linux_v22_1_2_7 (1).deb'"
and the error it is throwing is:
dpkg: error: cannot access archive '/home//Linux_Test/'SentinelAgent_linux_v22_1_2_7 (1).deb'': No such file or directory
I have changed the variable from "USERNAME" to just "USER" but that attempts to run it as root.

Cannot run "vagrant up" in PhpStorm 6 in command line

I am trying to launch my Vagrant directly from Phpstorm 6 but I am not able to find the command (Windows).
Screenshot : http://i.stack.imgur.com/d8aUA.png
Is there anything I could do to make it works ?
Thanks!
Have you created an alias for vagrant in "Settings | Command Line Tool Support" ?
Command Line Support Tool does not know what vagrant is, so it tries to execute whole command as is. The problem is -- proper name of app should be vagrant.bat (or vagrant.cmd -- do not remember) -- IDE does not add .bat/.exe/etc automatically like DOS/Windows does.
So either use vagrant.bat up command instead .. or (which is better) create an alias.
P.S.
PhpStorm v7 will search for .bat/.cmd/.exe/etc in your PATH if exact command cannot be found. Still -- making an alias is the best/safest way to go here in Command Line Tools.
An excerpt from: https://www.jetbrains.com/phpstorm/webhelp/vagrant.html
Make sure that the parent folders of the following executable files
are added to the system PATH variable:
vagrant.bat or vagrant from your Vagrant installation. This should be done automatically by the Vagrant installer.
If you've installed Vagrant the standard way then just restart the command prompt itself or phpStorm so it reloads the PATH. Else just find that bat file and run it manually to see if it works or better add the path to the system PATH var.

Vagrant: how to edit files on the Vagrant server?

I'm following these instructions for setting up a Django app on Vagrant.
I have successfully completed them and started Django, but: how can I now edit the Django files within my usual text editor, TextMate?
I guess I can ssh and use vi to edit them from the command line, but I thought the point of Vagrant was to be able to use my usual editing tools.
I'm just not sure where the Django files are physically located.
Apologies if this question is off-topic, I'll happily post it elsewhere, if editors can let me know where is best.
That web site is exactly the same place I started a few months ago.
Since I've learned more about Vagrant since then, I've created my own GitHub repo. You can download it here:
https://github.com/FlipperPA/djangovagrant
The way it is setup:
git clone the repo to a local directory on your machine
cd into that directory
run "vagrant up"
the directory you run "vagrant up" in is mapped to /vagrant on the guest virtual machine
Here is a working example of the way one might do it:
cd $home
git clone https://github.com/FlipperPA/djangovagrant.git
cd djangovagrant
vagrant up
vagrant ssh djangovm
cd /vagrant
django-admin.py startproject django_project
cd django_project
python manage.py runserver [::]:8000
You will then see the Django Project build on your local machine in the "djangovagrant" folder you created by the clone command above. You can you Textmate, Sublime, or any text editor you like to edit the files locally, and they'll be mapped to the guest VM.
I hope this helps - good luck.
Vagrant always synchronizes the files in the project you set up with your PC.
So whenever you ssh into the vagrant, (usually) in /vagrant directory you can see all the files you have in the root folder of your project (directory where Vagrantfile ruby script is)
Now you can use your text editor and save the file in a folder you want (for convenience, always save new files inside the project directory). now mirroring your directory structure around the /vagrant directory you can see the file being saved in the appropriate folder in your guest machine.
For e.g if you created and saved a file in your project root folder then you can see it appear in /vagrant directory.

Mongodb Windows Install Fail

I am trying to install mongodb on my local computer. I have windows 7 and 64 bit. I am following these instructions which are given on mongo's website:
64-bit binaries:
Download and extract the 64-bit .zip.
Unzip the downloaded binary package to the location of your choice. You may want to
rename mongo-xxxxxxx to just "mongo" for convenience.
Create a data directory:
By default MongoDB will store data in \data\db, but it won't
automatically create that folder, so we do so here:
C:\> mkdir \data
C:\> mkdir \data\db
Or you can do this from the Windows Explorer, of course.
If you prefer to place datafiles elsewhere, use the --dbpath command line parameter
when starting mongod.exe. Run and connect to the server
The important binaries for a first run are:
mongod.exe - the database server. Try mongod --help to see startup options.
mongo.exe - the administrative shell
To run the database, click mongod.exe in Explorer, or run it from a CMD window.
C:\> cd \mongodb\bin
C:\mongodb\bin> mongod
Note: It is also possible to run the server as a Windows Service. But we can do that
later.
When i follow these steps i get the following error:
'C:\' is not recognized as an internal or external command, operable program or batch
file.
I am not sure what is going wrong i have followed the direction exactly. I extracted the zip file on my c drive as mongodb. I then created the folder data on my c drive and the folder db inside the data folder. I start the windows cmd line and do as they suggest and i get the above error. Can anyone help please. Thank you.
Don't type the C:\>, that's the command prompt.
For example, just type:
cd \mongodb\bin
and then press enter.
you may want to use this powershell that dowloads mongodb and installs it as windows service...
https://gist.github.com/serdarb/5102848

Resources