Showing posts with label DOS. Show all posts
Showing posts with label DOS. Show all posts

Wednesday, June 10, 2015

MSDeploy : Registry editing has been disabled by your administrator

Was installing a web site in IIS on Windows Server 2012 R2 and using msdeploy.

Came up with:

Registry editing has been disabled by your administrator

Mr Google etc. and there's pages about using gpedit.msc and navigating to "User Config / Admin Templates / System" and finding the entry "Prevent access to registry editing tools" and making it "Not configured" or "Disabled" etc.

Actually, all you need to do is add:

set MSDeployPath=C:\Program Files\IIS\Microsoft Web Deploy V3\

to the DOS settings!

Obviously, you need to install msdeploy beforehand.

Enjoy!

Tuesday, January 20, 2015

DOS : long file names

There are times when long file names are a pain.

I had a batch file that called a file inside a directory and the directory had spaces in the name e.g.

c:\a long name\another long name\program.exe

And it wouldn't damn well find it. Kept getting error messages like "File x ...".

I used "" and everything else I could think of.

Then from a long-distant past, I remembered DOS and the command

dir /x

This displays the short names generated for non-8dot3 file names.

So e.g. C:\Program Files\Resource Kit becomes C:\PROGRA~1\RESOUR~1

Putting the short name in the batch file solved the problem.

Go figure.

Enjoy!



Thursday, November 06, 2014

Windows Server: Where's the drive mapping?

Needed to map a drive on Server 2012 R2 to load some media so:

Start - right click "This PC" - check "Map network drive"

Than map to G: e.g.

Into command prompt with run as administrator set - type "G:" - no such drive - WTF? - I can see the mapping in File Explorer!

Turns out you have to do an extra step i.e.

net use g: \\"mapping path" password /user:domain\user /p:no

where:
g: = drive to map
mapping path = path to media
password = your password
/user:domain\user = your domain and user
/p:no = don't persist mapping across logins

Job done.

I suspect this will work on Windows 8 as well.

Enjoy!

Thursday, September 13, 2012

Windows : File names that start with a period

 

If you play around with Java on your Windows box, sooner or later you are going to hit the problem where you need to create a file that starts with a period (aka. dot or full stop) e.g. “.keypass”.

Explorer won’t let you do this.

The solution is to create a file called keypass (no period) in Explorer and then use the command prompt to run a DOS command:

ren keypass .keypass

“ren” = “rename”

Good, old DOS to the rescue!

Enjoy!

Monday, February 16, 2009

XP : DOS equivalent of Traceroute

I've used Traceroute often to trace the path between two hosts and highlight potential bottlenecks.

But it is not a Windows program. However, "PathPing" is a network utility in XP.

"It combines the functionality of Ping with that of Traceroute (in Windows: tracert), by providing details of the path between two hosts and Ping-like statistics for each node in the path based on samples taken over a time period".


C:\>pathping

Usage: pathping [-g host-list] [-h maximum_hops] [-i address] [-n]
[-p period] [-q num_queries] [-w timeout] [-P] [-R] [-T]
[-4] [-6] target_name

Options:
-g host-list Loose source route along host-list.
-h maximum_hops Maximum number of hops to search for target.
-i address Use the specified source address.
-n Do not resolve addresses to hostnames.
-p period Wait period milliseconds between pings.
-q num_queries Number of queries per hop.
-w timeout Wait timeout milliseconds for each reply.
-P Test for RSVP PATH connectivity.
-R Test if each hop is RSVP aware.
-T Test connectivity to each hop with Layer-2 priority tags.
-4 Force using IPv4.
-6 Force using IPv6.


Or (as above), use tracert.


C:\>tracert

Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

Options:
-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list.
-w timeout Wait timeout milliseconds for each reply.


Enjoy!

Thursday, July 05, 2007

DOS 'grep' equivalent - the find command

The previous post talked about finding which ports were open using the netstat command.

But you still have to scan the output manually to find the port you are looking for.

In the Unix world you could simply use grep and pipe the output to it.

In the DOS world, you can use find.


help find

Searches for a text string in a file or files.

FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]

/V Displays all lines NOT containing the specified string.
/C Displays only the count of lines containing the string.
/N Displays line numbers with the displayed lines.
/I Ignores the case of characters when searching for the string.
/OFF[LINE] Do not skip files with offline attribute set.
"string" Specifies the text string to find.
[drive:][path]filename
Specifies a file or files to search.

If a path is not specified, FIND searches the text typed at the prompt
or piped from another command.



So to find if port 86 was open, use:

netstat -ano | find /i "86"

and the filtered output would something like:



TCP 0.0.0.0:86 0.0.0.0:0 LISTENING 728
UDP 0.0.0.0:86 *:* 728



Enjoy!