Entries Tagged as 'Windows'

MS Windows cmd.exe window and Fullscreen

Misc , Tips and Tricks , Windows 7 Comments »

Today I was faced with an interesting dilema...

I was writing some windows batch  scripts to automate some Subversion tasks and I wanted to re-configure the display of the windows cmd.exe window.  I know Console2 and DOSBox are out there but cmd.exe is the default so I'm running with that for now.

So, in the cmd.exe properties dialog (right-click the title bar and select defaults) I configured the command window / dialog display options to be "Full Screen".

Once I ran my batch file, cmd.exe turned my laptop into a dumb terminal / DOS interface while running the sequence of events I had configured.  It's okay, once complete it return back to Windows normally but that wasn't the effect I was after!!  I simply wanted a larger command window within windows...

PROBLEM

The problem now though was - How the hell do I get back to "Window" mode?  Everything I ran with cme.exe was switching to this mode!!

ANSWER

Quite simply using the key combination Alt+Enter, I was able to toggle between "Window" and "Full Screen" mode.

Pheeewwwww.

So hopefully someone else looking for this Gem will find it here!!

Bookmark and Share

GitHub, SSH and Windows

GitHub , Windows 3 Comments »

As part of scratching my itch to learn Ruby I decided to create a GitHub repository for storing my code, downloaded samples and koans.  Being mainly a Subversion user I decided to use GitHub for this, simply to extend my knowledge of this popular version control system.

When setting up GitHub using the detailed instructions here I ran into an issue when testing my SSH Connection, which GitHub uses to enable secure communications between your computer and the server.  Using GitBash I entered the following command:

$ ssh -T git@github.com

$ Permission denied (publickey).

I resorted to the documentation and found the following command:

$ ssh -vT git@github.com

Using the switch -vT instructs the terminal to show debug details.  Upon reviewing this debug I noticed that the session connected successfully but when trying to authenticate with my generated public key, the files being searched for where not the same as the name I created for mines.

OpenSSH was searching the .ssh folder for one of the following public key file names:

  • identity
  • id_rsa
  • id_dsa

To resolve this issue - I renamed the key files to id_rsa which resolved this issue for me.  There were two in the .ssh directory (id_rsa.pub and id_rsa).

So when creating an ssh key, when asked to enter a file in which to save the key - simply hit "Enter" and it will use the default settings.

HTH.

Bookmark and Share

Using <cfexecute/> with Windows Batch Files

ColdFusion , Windows , Gotchas 3 Comments »

Recently I wrote some batch files to complement some scheduled tasks I was developing to help with automating some processes that were being carried out manually by system administrators on applications deployed in a Microsoft Windows environment.

In doing so I came across a number of minor issues that I had to figure out, so I thought I'd share them here for anyone else who's ever required to do anything similar.

I was calling the batch file using the <cfexecute /> tag and passing some arguments to keep the script cohesive enough that its functionality could be used on other servers.

The code final code I used is below but I have discussed the important parts that I had left out.

<cftry>
    <cfscript>
        args = [1];
        args[1] = "argument1Value";
        args[2] = "argument2Value";
        args[3] = "argument3Value";
    </cfscript>
    <cfexecute variable="batchScriptOutput" 
	              name="#APPLICATION.BATCH_SCRIPT_DIRECTORY#\#APPLICATION.NAME_OF_SCRIPT#" 
				  arguments="#args#" 
				  timeout="99999" 
				  errorVariable="batchScriptError" 
	/>
    <cfoutput>
         SCRIPT OUTPUT:<br />#batchScriptOutput#<br />
         ERRORS:<br />#batchScriptError#<br />
    </cfoutput>
	<cfcatch>                
	    <cfrethrow />        
	</cfcatch>
</cftry>

The issues I had were that:

  • I wanted to pass argument values that had spaces in them
  • I wanted to see the output generated by the batch file

Neither of this seemed possible without formatting the code as I have above.  If a "timeout" value wasn't set, I didn't get the output returned and it just seemed simpler to pass the arguments as an array.

If anyone has had any similar experiences or better methods of implementation, I would like to hear your thoughts.

Bookmark and Share
Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds