[cmd]Batch – Filename Parameter Extensions Август 25, 2009
Posted by russenreaktor in windows.add a comment
«When a parameter is used to supply a filename then the following extended syntax can be applied:
we are using the variable %1 (but this works for any parameter)
%~f1 – expands %1 to a Fully qualified path name – C:\utils\MyFile.txt
%~d1 – expands %1 to a Drive letter only – C:
%~p1 – expands %1 to a Path only – \utils\
%~n1 – expands %1 to a file Name, or if only a path is present – the last folder in that path
%~x1 – expands %1 to a file eXtension only – .txt
%~s1 – changes the meaning of f, n and x to reference the Short name (see note below)
%~1 – expand %1 removing any surrounding quotes («)
%~a1 – display the file attributes of %1
%~t1 – display the date/time of %1
%~z1 – display the file size of %1
%~$PATH:1 – search the PATH environment variable and expand %1 to the fully qualified name of the first match found.
The modifiers above can be combined:
%~dp1 – expands %1 to a drive letter and path only
%~nx2 – expands %2 to a file name and extension only» ss64.com
How do I pass parameters to a batch file? Май 18, 2009
Posted by russenreaktor in windows.add a comment
«A. When you call a batch file, you can enter data after the command that the batch file refers to as %1, %2, etc. For example, in the batch file hello.bat, the following command
@echo hello %1 boy
would output
hello john boy
if you called it as
hello john
The following table outlines how you can modify the passed parameter.
Parameter Description
%1 The normal parameter.
%~f1 Expands %1 to a fully qualified pathname. If you passed only a filename from the current directory, this parameter would also expand to the drive or directory.
%~d1 Extracts the drive letter from %1.
%~p1 Extracts the path from %1.
%~n1 Extracts the filename from %1, without the extension.
%~x1 Extracts the file extension from %1.
%~s1 Changes the n and x options’ meanings to reference the short name. You would therefore use %~sn1 for the short filename and %~sx1 for the short extension.
The following table shows how you can combine some of the parameters.
Parameter Description
%~dp1 Expands %1 to a drive letter and path only.
%~sp1 For short path.
%~nx1 Expands %1 to a filename and extension only.
To see all the parameters in action, put them into the batch file testing.bat, as follows.
@echo off
echo fully qualified name %~f1
echo drive %~d1
echo path %~p1
echo filename %~n1
echo file extension %~x1
echo short filename %~sn1
echo short file extension %~sx1
echo drive and directory %~dp1
echo filename and extension %~nx1
Then, run the file with a long filename. For example, the batch file run on the file c:\temp\longfilename.long would produce the following output.
fully qualified name c:\TEMP\longfilename.long
drive c:
path \TEMP\
filename longfilename
file extension .long
short filename LONGFI~1
short file extension .LON
drive and directory c:\TEMP\
filename and extension longfilename.long
This method also works on the second and subsequent parameters. You simply substitute the parameter for 1 (e.g., %~f2 for the second parameter’s fully qualified path name).
The %0 parameter in a batch file holds information about the file when it runs and indicates which command extensions you can use with the file (e.g., %~dp0 gives the batch file’s drive and path).» windowsitpro.com
Launchy: The Open Source Keystroke Launcher Март 18, 2009
Posted by russenreaktor in windows.add a comment
«Launchy is a free windows and linux utility designed to help you forget about your start menu, the icons on your desktop, and even your file manager.
Launchy indexes the programs in your start menu and can launch your documents, project files, folders, and bookmarks with just a few keystrokes!» launchy.net
HOWTO: Combining multiple Word documents into a single document. Март 15, 2009
Posted by russenreaktor in windows.add a comment
«In Word 2000, do the following:
1. Open the first document
2. Move cursor to end of that document (or the next page after the end)
3. Go to «Insert» on the top menu, and from the dropdown list select «File», and browse to the next document.
Repeat steps 2 and 3 until all documents (chapters) have been added.» computing.net
What to do when Word crashes? Январь 27, 2009
Posted by russenreaktor in windows.add a comment
«Such is the nature of the beast that sooner or later Word will crash. When you restart, Word may try and recover the document you were working on, but this is a bit hit and miss, so don’t rely on it. Configure Word to create a backup file – and save often. It is good practice to drill CTRL+S into your brain and apply it every time you pause for thought. Then when the wheel comes off, you don’t lose too much work.» gmayor.com
Tabbed Putty Январь 21, 2009
Posted by russenreaktor in windows.Tags: apps, putty
add a comment
1) http://www.raisin.de/putty-tabs/putty-tabs.html
Download Executable (~20kB, .NET 2.0 required)

How To Change the Windows XP Product Key Code Декабрь 2, 2008
Posted by russenreaktor in windows.Tags: license, xp
add a comment
- «Click on Start and then Run.
- In the text box in the Run window, type regedit and click OK. This will open the Registry Editor program.
- Locate the HKEY_LOCAL_MACHINE folder under My Computer and click on the (+) sign next the folder name to expand the folder.
- Continue to expand folders until you reach the HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\Current Version\WPAEvents registry key.
- Click on the WPAEvents folder.
- In the results that appear in the window on the right, locate OOBETimer.
- Right-click on the OOBETimer entry and choose Modify from the resulting menu.
- Change at least one digit in the Value data text box and click OK. This will deactivate Windows XP.
- Click on Start and then Run.
- In the text box in the Run window, type the following command and click OK.
- %systemroot%\system32\oobe\msoobe.exe /a
- When the Windows Product Activation window appears, choose Yes, I want to telephone a customer service representative to activate Windows and then click Next.
- Click Change Product Key.
- Type your new, valid Windows XP product key in the New key text boxes and then click Update. » pcsupport.about.com
SOLVED: tortoise(svn) + putty(ssh) + pageant = no password input needed Октябрь 29, 2008
Posted by russenreaktor in develop, linux, windows.Tags: linux, pageant, putty, ssh, svn, tortoise, windows
add a comment
«Lets do this step by step:
- login to your server
- type: ssh-keygen -b 1024 -t dsa -N passphrase -f mykey
- change «passphrase» to a secret keyword only you know
- type: ls -l mykey*
We just created a SSH2 DSA key with 1024 bit keyphrase. You will see two files. One named «mykey» and one named «mykey.pub». As you might guess, the .pub file is the public key file, the other is the private one. Next create a user on the server with a home directory:
- type: useradd -m myuser
You will have a directory under /home with the name «myuser», create a new directory in «myuser» called «.ssh»:
- type: cd /home/myuser
- type: mkdir .ssh
Then go to the directory where you created your keys and copy the public key to the .ssh userfolder with the following command:
- type: cp mykey.pub /home/myuser/.ssh/authorized_keys
or if you already have some keys in place
- type: cat mykey.pub >> /home/myuser/.ssh/authorized_keys
Please pay attention to the filename, it really must be «authorized_keys». In some old OpenSSH implementations, it was «authorized_keys2″. Now download the private key file to your client computer. Remember, the file was «mykey»
————————————————————
SSH key generation and connection check (client)
————————————————————
Grab the tools we need for doing SSH on windows on this site:
http://www.chiark.greenend.org.uk/~sgtatham/putty/
Just go to the download section and get «Putty», «Plink», «Pageant» and «Puttygen»
In order to use the private key we get from the server, we have to convert it to a putty format. This is because the private key file format is not specified by some standard body. To do this we simple open «puttygen» and open the «conversions» menu and chose «Import Key». Then browse to your file «mykey» which you got from the server enter your provided passphrase upon creation of the key. Finally click «Save private key» and save the file as «mykey.PPK» somewhere on disk.
Now we are ready to use this key for the first time to test the connection. In order to do this, we open the program «putty» and create a new session like this:
Session->HostName: Hostname or IP Adress of your server
Session->Protocol: SSH
Session->Saved Sessions: MyConnection
SSH->Prefered SSH Protocol version: 2
SSH->Auth->Private Key file for auth: $PATH$\mykey.PKK (replace $PATH$ with real path to the mykey.PKK file)
Then go back to Session tab and hit «save» button. You will see «MyConnection» in the list of available connections.» tortoisesvn.net
trueSpace 7.6 Download links Октябрь 28, 2008
Posted by russenreaktor in windows.Tags: 3d, free, truespace, windows
add a comment
«Please download the files from the links provided below:
Download trueSpace7.6 full installation (software and all libraries) – 130MB
Download trueSpace7.6 PDF Manual – 51MB
Download trueSpace7.6 Videos – 132MB
Once you’ve downloaded and installed the software, be sure to read through the Manual » cart1.caligari.com
