You’ll need to open Command Prompt in Admin mode to make the changes especially when User Account Control (UAC) is enabled on your Windows 10 machine. CD to system32 for 64-bit registration and SysWoW64 for 32-bit registration. Place the COM component in the folder from you want to register and also your executable is placed e.g. “C:\TFS\Code\bin\” in the example below.
To register use the below command:
To unregister use the below command:
regsvr32 /u "C:\TFS\Code\bin\MailObj.dll"
You should get a prompt that the register/unregister command succeeded. This command can be used to register/unregister DLL or OCX files.
Robocopy is a robust file copy command for the Windows command line. It allows users to copy files, directories, and even drives from one location to another. It can be automated with Task Scheduler to run at specific times.
Robocopy example to copy a file from Source to Destination:
Robocopy [Src] [Dest] [filename] [options]
Src: Can be local or UNC path
Dest: Can be local or UNC path
Code Sample batch file:
echo Sync Started
Robocopy C:\Data\TestFolder C:\Data\Logs\TestFolder\%DTVARYEAR%-%DTVARMONTH%-%DTVARDATE%_TestFolder testlogfile.log /FFT /Z /XA:H /LOG+:C:\Data\SchedTasks\LogsTest\%DTVARYEAR%-%DTVARMONTH%_AppLogs.txt
echo Log synced
The above code will copy the testlogfile.log from Source to Destination.
Options: /FFT Assumes FAT file times (two-second precision). /Z Copies files in restartable mode. /XA:H exclude hidden file /LOG+ log output to file and append.
Additional useful options: /MIR Mirrors a directory tree (equivalent to /e plus /purge). /XF exclude specified file /XD exclude specified directory
We’re going to use Bash on Ubuntu on Windows as it allows you to run Linux on your Windows machine. This only works on 64-bit installations of Windows. Reboot your machine once the installation completes.
Search for Bash in your start menu and follow the installation instructions to get the Ubuntu subsystem installed on Windows 10 which will be downloaded from the Windows Store. Or you can download and install from Windows Store here for Ubuntu 16.04 LTS version. Launch the downloaded version from Windows Store and install it.
You can also use the command as shown below to download and install from Microsoft Store:
Setup the username and password for the Linux subsystem. The user must be a sudoer to use system commands at the root level. Once the installation is completed you’ll be able to search for Bash on Ubuntu on Windows in your start menu.
If you face any issues and need to uninstall again,
open command prompt (not bash):
lxrun /uninstall /full
Then Turn of the Windows feature for Linux subsystem and follow the installation steps again.
First, we need to install some dependencies for Ruby environment. Install the latest recommended version. We’re currently working with Ruby 2.5.3 but this may change in future. Run the following commands in Bash (Remove $ sign as this is part of the prompt at the terminal):
We’ll install the current latest version of
You can check the installed rails version as below:
$ rails -v
Download the latest version of PostgreSQL from the as recommended in Official PostgreSQL site. For, Windows 10 64-bit version, use the highlighted version. Download the installer certified by EnterpriseDB for all supported PostgreSQL versions.
This is the full installer that comes with PGAdmin4. Follow the installer steps and note down the username and password used while configuring the installation. The database Server runs using the default port 5432. After the installation completes, run the PostgreSQL Service.
Setup Demo Rails Project:
Let’s create a folder under the C: on Windows which is accessible in Linux under /mnt/c.
$ cd /mnt/c
$ mkdir –p code
$ rails new demoapp –d postgresql
$ cd demoapp
When you change the directory to the demoapp, you’ll find a lot of files created automatically by Rails framework structured using the MVC pattern. This is equivalent to C:\code\demoapp on Windows. In order to further build the app and automatically create the database in PostgreSQL, we need to first modify the config/database.yml file with the correct username and password which was used while installing the PostgreSQL software.
To do this, we can use popular code editor tools like Visual Studio code, Sublime text, Atom etc. We’re going to use Visual Studio Code. You can download and install it here. Open the DemoApp folder in Visual Studio code and find the database.yml under the config folder. Modify the file as shown below. Provide the required password used during installation. This file has the configuration for creating the database under different environments like dev, test and production. Default database.yml format.
Create the database:
The below commands should be run while
you’re inside the demoapp folder in Ubuntu Bash.
We can use the rake utility to
create and manage the database using the command line tool. Run the below
command to create the database:
$ rake db:create
Once the database is up and running, run the rails Server to access the application.
You can use the Git configuration steps if you’re using version control for your code using GitHub or any other Git Service provider. The general process is to use SSH protocol and creating the public-private key pair. The public key requires to be added in the SSH keys section of the provider with a title while the private key should not be shared. This helps in creating a SSH tunnel from your machine to the provider like GitHub.
$ ssh-keygen -t rsa -b 4096 -C "YOUR@EMAIL.com"
Navigate the .ssh folder outside the demoapp folder:
$ cd .ssh
And copy the rsa public key generated above using text editors like vim or nano.
$ vim id_rsa.pub
You can check if the connection successfully established with your provider account and you should see a success message e.g.