Got more questions? Find advice on: ASP | SQL | XML | Regular Expressions
in Search
Welcome to WindowsAdvice Sign in | Join | Help

Steven Smith

Windows Tips and Tricks

  • Move Files in Vista without Prompting

    Is there a way to move files in Vista without prompting for system-only or read-only or whatever?  If so, I'd love to know the key combination to achieve it.  I'm moving some files from another PC's hard drive to my Vista machine using a USB connector, and the process is basically open up two copies of windows explorer, find the files I want in the USB drive in one, find the location I want on my local drive in the other, and right click, drag, drop, select Move.  This process has worked fine for years, and in XP it would prompt me for various things but I could always say "Yes, I really did want it to move the stuff I just said I wanted to move." and it would work.

    In Vista, the prompts come, but even after saying "Yes, really, I know, I want to move them." it will move the files, but the folders are left behind.  So the process ends up being select the stuff to move, right-click-drag it, select Move, say OK to the stupid prompt, wait for the move to finish, oops, there are still folders left behind -- grab them again, right-click-drag them again, select Move again, select "Yes I want to copy them even though they exist".  At which point, usually, the folders are moved properly.

    How can I reduce this process (without dropping down to use Robocopy in the shell) to make it so when I say Move Files what I really mean is "Really F***ING MOVE The Files, I Mean It" so I don't have to go through this dance every time?

    Sponsor
  • Automise on Bits du Jour Today Only 90% Off

    From Tate Needham of Automise:

    Yes, that's right, Automise is on Bits du Jour *today* (Wednesday 29th November 2006).  If you didn't already know, Automise is very similar to FinalBuilder but aimed at Sys Admin, Network Admins and other IT professionals.  It's got the power and ease of use of FinalBuilder, but is cheaper and lacks the developer specific stuff (like compilers, version control systems, etc).

     

    http://www.bitsdujour.com

     

    Bits du Jour is a "One deal a day" website (like Woot!) that features software products.

     

    No obligation, but we'd appreciate it if you could spread the good news via your blog, forum, del.icio.us, etc. that Automise is currently being featured at BDJ.

     

    In fact, the discount is pretty amazing - Automise normally sells for $195.00 US, but today it's only $19.50 !  How's that for a good deal? :)

     

    Sponsor
  • Microsoft Buys Winternals

    Today it was announced that Microsoft has acquired Winternals.  You can read more about the acquisition here.
    Sponsor
  • Interesting USB Drive Security Exploit

    Some white hat security professionals used USB drives to circumvent security at a credit union they were assessing.  Basically, they install trojans on the drives and left them where the employees would find them (parking lot, smoking areas, etc.).  Then they sat back and waited for the employees to find them, take them into work, plug them in, and run the trojan files while they explored their newfound toys' contents.  Brilliant.

    Excerpt:

    After about three days, we figured we had collected enough data. When I started to review our findings, I was amazed at the results. Of the 20 USB drives we planted, 15 were found by employees, and all had been plugged into company computers. The data we obtained helped us to compromise additional systems, and the best part of the whole scheme was its convenience. We never broke a sweat. Everything that needed to happen did, and in a way it was completely transparent to the users, the network, and credit union management.

    Of all the social engineering efforts we have performed over the years, I always had to worry about being caught, getting detained by the police, or not getting anything of value. The USB route is really the way to go. With the exception of possibly getting caught when seeding the facility, my chances of having a problem are reduced significantly.

    Read the full article.

     

    Sponsor
  • Vista, Longhorn Server, Office 12 Beta 2 Released Today

    For MSDN Subscribers, you should be able to download the beta 2 bits for these products now.  They're also available on the Connect site for Microsoft Beta participants.
    Sponsor
  • Tech Ed Boston

    I will be attending Tech Ed this year in Boston in a few weeks.  You can find the conference agenda and list of sessions online.  There are two Windows-specific tracks, a Windows Client track that includes 32 sessions and a Windows Server Infrastructure track with 55 sessions, including one by Mark Russinovich on the black art of Windows Hang and Crash Dump Analysis that I think I'll attend.

    Personally, I'm more into the developer side of things, and there are 83 sessions in the Developer Tools track.  I'm hoping to make the time to make it to several of these sessions, including some of the WinFX, WPF, WWF, and Atlas sessions.  I'm also hosting a Birds-of-a-Feather session on Thursday on Caching in .NET Applications, where I hope there will be some good discussion about when, how, and why to use caching.

    Sponsor
  • Wireless Node Type Causes LAN Errors

    I went to PDC in LA last week and now when I get back home I find that I can no longer access some of my network file shares or ping certain computers on the LAN.  A few other people on some lists I'm on were having the same issues.  Apparently being at the convention and using its wireless had set our wireless cards to use Peer-To-Peer mode, and as such they were locked down.  One of these folks found the cure which is detailed in this blog entry.  I made the switch in my registry and it worked like a charm.  Try it at your own risk, of course.

    In case that link dies, here's the important part:

    You need to edit this key in your registry. Normal disclaimers apply if you don't know what you're doing.


    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters


    DhcpNodeType should be 8, not 2, to enable broadcast lookups. You can release and then renew ipconfig to pick up the change.

     

    Sponsor
  • Hidden Network Cards

    I just moved a server and switched it from using a wireless card to a 10/100 Ethernet port and I kept getting this kind of message when I set it back up with its IP addresses:

    The IP address XXX.XXX.XXX.XXX you have entered for this network adapter is already assigned to another adapter Name of adapter. Name of adapter is hidden from the network and Dial-up Connections folder because it is not physically in the computer or is a legacy adapter that is not working. If the same address is assigned to both adapters and they become active, only one of them will use this address. This may result in incorrect system configuration. Do you want to enter a different IP address for this adapter in the list of IP addresses in the advanced dialog box?
     
    Unfortunately, I couldn't figure out a way to remove the IPs from the wireless card since it was (a) hidden and (b) not around to plug in.  I found this KB article which quickly showed me the light:
     

    Error Message When You Try to Set an IP Address on a Network Adapter

    In case Microsoft decides to break that link (it's been known to happen), here's the resolution:

    To resolve this problem, uninstall the ghosted network adapter from the registry:

    1. Click Start, click Run, type cmd.exe, and then press ENTER.
    2. Type set devmgr_show_nonpresent_devices=1, and then press ENTER.
    3. Type Start DEVMGMT.MSC, and then press ENTER.
    4. Click View, and then click Show Hidden Devices.
    5. Expand the Network Adapters tree.
    6. Right-click the dimmed network adapter, and then click Uninstall.

    Sponsor
  • ACS 495 Speaker Tips

    I pulled out my old Altec Lansing ACS495 speakers and have been trying to use them with my Alienware running Windows XP.  Unfortunately the software to manage the speakers via USB only works with Windows 98 (kinda tells you how old these are).  However, in my latest Google attempt I found this thread, which reminded me that I can at least get the speakers into surround sound mode by pressing the center button and holding it for about 2 seconds.  They do in fact sound *much* better that way...

     

    Sponsor
  • Bye Bye Longhorn, Welcome Windows Vista

    Today Microsoft announced Windows Vista, formerly codename "Longhorn".  Julie has a screenshot on her blog.  Beta 1 for WindowsVista will be available very soon, on August 3rd.
    Sponsor
  • New Builds of Indigo and Avalon Released

    Download them now!

    From the site:

    Indigo and Avalon are the codenames for two strategic developer technologies that Microsoft plans to ship in 2006 as part of the Windows "Longhorn" operating system. In addition, Microsoft is making these technologies available on Windows XP and Windows Server 2003. The Indigo and Avalon Beta1 "RC" enables developers to continue experimenting with early builds of these technologies, get acquainted with the development experience, and provide Microsoft with feedback.

     

    Sponsor
  • Right Click to Open a Command Prompt

    I always need this whenever I rebuild my system.  Here's where I found it this time via Google:

    http://www.tech-recipes.com/windows_tips232.html

    Steps:

    Manual Method:
    (This requires editing your registry. If you are not familiar with registry editing, this isn't for you... so skip to the easy method below)
    1. Open regedit
    2. Navigate to HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell
    3. Create a new key called Command Prompt
    4. Your default value should be Command Prompt Here
    5. Create a new key called Command under the Command Prompt key
    6. Your default value should be cmd.exe /k pushd %L

    Also, the Windows XP Power Toy that does it.

    Sponsor
  • ADSI Design Rules

    I'm not the original author of these and I don't know who is, but I've had this list on paper for a long time and it's time to put it online so I can pitch the paper copy.

    ADSI Design Rules

    1. Never Hard Code the Server Name.  Use "Serverless Binding" when connected to or attempting to find the best directory server.  Serverless binding extends scalability by allowing for access to the directory service without regard to where the directory store exists (which server or servers) or if it exists across multiple directory servers.  ADSI will actually locate the "best-connected" directory server in the namespace subnet automatically.  ADSI will bind to the default domain without specifying the primary domain controller.  This is the domain associated with the current security context of the thread that's doing the binding.

      For ordinary applications, this is typically the domain of the logged-on user.  For service applications, this is either the domain of the servivce's logon account or that of the client that the service is impersonating.

      Use rootDSE to retrieve information about the directory server, such as its name (ServerName).

      The ADsPath string for rootDSE LDAP reference is:
      LDAP://rootDSE

      The rootDSE can be referenced because it does not exist in any namespace, and therefore is global in scope.  The rootDSE has many other useful properties that should be exploited, such as currentTime and namingContexts among many others.
    2. Use rootDSE to Get the Distinguished Name for a Namespace.  Dynamically read the namingContexts property of rootDSE to access the distinguished name of the namespace and distinguished names of all of the objects in the namespace.
    3. Use OIDGEN to Generate Unique Identifiers for New Attributes (or Other Objects).  Microsoft delivers the oidgen command line tool to list available unique object identifiers for use within the PlanSoft applications and services.  Always use identifiers in the listed range for new classes or attributes.
    4. Use the Following Class and Attribute Naming Rules. You must explicitly specify the IDAPDisplayName for all of your attributes and classes.  Do not let ADSI auto-generate this name from the Common-Name.

      Use the same name for both the Common-Name (cn) and the LDAP-display-name (IDAPDisplayName) of a new attributeSchema or classSchema object.

      Identify your company with a lower-case prefix in the first section of the name.  This prefix can be a DNS name, acronym, or other string that uniquely identifies your company.  The prefix ensures that all attributes and classes for a specific company are displayed consecutively when browsing the schema.

      Use a hyphen as the next character (after the prefix).

      Specify an attribute or class name that is unique within your company after the hyphen.  This part of the common-name should be descriptive.  Don't use cryptic names that are meaningless to developers and viewers of the schema.
    5. Minimize the Use of Objects (Classes and Attributes) in the Global Catalog.  If you can find an existing use of one of the existing classes or attributes, then use it and don't create a custom attribute or class to accomodate the new property.  Other factors:

      The attribute is "globally interesting."  Either the attribute is needed for locating objects that may occur anywhere in the forest, or read access to the attribute is valuable even when the full object is not accessible.  An example of the first type is the location attribute, which can be used to find a printQueue object no matter where that object is located.  An example of the second type is telephoneNumber, because you can phone someone even if you can't access a full replica of his user object.

      The volatility of the attribute is very low.  This is important, because if an attribute class is included in the global catalog, changes to every value of that attribute class throughout the enterprise forest are replicated to all global catalog servers in the enterprise.

      The size of the attribute is small.  "Small" is highly subjective:  when placing an attribute in the GC you must consider the impact of replicating the attribute to all GC servers in the enterprise.  The smaller the attribute, the lower the impact.  Because replication occurs only when the attribute changes, the impact of replication is also smaller as volatility decreases, so a large attribute with very low volatility may have a smaller overall impact than a small attribute with high volatility.
    6. Group all ACLs to be Used for BizTalk Server Into a Single Group.  This will enable you to use a unique identity for each server application and treat them the same with respect to ACLs on other system resources.
    Sponsor
  • Windows Batch File Commands

    Wrote a batch file just now to do some DB setup for a Whidbey application that needs some ASP.NET features like Membership and Personalization.  So it has to call aspnet_regsql.exe a few times.  I used to write a lot of UNIX shell scripts, so I forgot what the comment character was for .bat files (hint, it wasn't '#').  In fact, it's not a character at all, but the lovely 'REM'.  Found this handy reference which includes the allowable commands:

    • @
      • Do not echo this line
    • ECHO
      • Send messages to user
      • Turn on/off output to user
    • REM
      • Comment out a line (short for remark)
    • PAUSE
      • prints "Press any key to continue..." and waits
    • GOTO
      • branches to a label
    • IF
      • can be used to check if a file exists or if a command returned an error
    • SHIFT
      • shifts command line params (useful if you have a lot of them I guess)
    • CALL
      • run another batch file from this one; allows reuse
    • FOR
      • allows looping
    • CHOICE
      • Prompts the user with a menu of choices and accepts one

    Obviously I'm not offering a ton of syntax here -- go to the reference for that.

    Sponsor
  • Editing the Hosts File

    If you've ever wanted to work on a production site while in development and verify that all of the links work properly (even the ones that include absolute URLs), an easy way to do it is to alter the HOSTS file on your development computer.  Your HOSTS file lets you map domain names to IP addresses, just like a tiny DNS (Domain Name Service), but only for your computer.  You'll find the HOSTS file here:

    C:\Windows\System32\Drivers\Etc\

    If you're going to be doing a lot of editing, you can add a shortcut to your desktop pointing to the file.

    Note that the HOSTS file does not have a file extension.  Do not add one.  You should edit the file with Notepad; just be sure it doesn't try to be helpful and add a '.txt' extension when you save it.

    Your Hosts file has entries like this one:
    127.0.0.1      localhost

    The first number is an IP address.   127.0.0.1 is a loopback address -- it always refers to your computer.  By default, localhost always maps to your computer because of this entry in the HOSTS file.  Let's say you're working on a site called 'mysite.com' and you want to test a local instance of it using that domain name.  You would simply ensure that your local webserver was set up to handle requests for that domain and IP address, and then add this line to the HOSTS file:

    127.0.0.1      mydomain.com

    Now when you open your browser and go to 'mydomain.com' it will hit your local webserver.  Similarly, if you go to a command prompt and try to ping mydomain.com, you'll get 127.0.0.1 back as the IP address.  To remove the entry, you can comment it out by adding a '#' to the beginning of the line you wish to remove:

    #127.0.0.1      mydomain.com

    If you have questions, feel free to comment.
    Sponsor