Your best source of information and news about windows, secrets and hardware on the internet

Vista ARTICLES TOP 50 Spyware Virus Vista SOFT Vista HELP

Command Line

You are currently browsing the articles from MS Windows Vista Compatible Software matching the category Command Line.

Date and time stamp in your batch files

There has been some activity recently in an old 2007 post I wrote about creating a date and time stamp in your batch files.

Well, the funny part was that I said ‘Date and Time’ in the subject, but I only talked about pulling out the current date.

Sue asked “What if I need both date, and time?”

Good question. What if you want to create a file that has the current date and time for each execution of the script?

In my old article I was creating zip files, using an imaginary command line based zip program. So in my article here I am going to make our goal to zip up a folder and name it:

YYYYMMDDHHMMSS_DATA.zip

If it were run today, our script should create a file by this name:

20091111143900_DATA.zip

To accomplish this, you need to use substring batch codes. If you want more detail on how these work, I explain it in the original article:

Create a date and time stamp in your batch files

To get the current time we use the %TIME% environment variable, and %DATE% for the date.

Using the substring batch codes from my old article, this is how we would pull out the year, month and day:

%date:~-4,4%%date:~-10,2%%date:~-7,2%

How about the time? That can be a little more difficult since the numbers returned from the time are not always the same length. For example, if it is 9 o’clock, it will say 9:00 – not 09:00. This will cause trouble when using the value for our filename.

Before we deal with that space, let me show you the substring codes to pull out the time:

Milliseconds: %time:~-2,2%
Seconds: %time:~-5,2%
Minutes: %time:~-8,2%
Hours: %time:~-11,2%

So naturally, if we wanted HHMMSS we could take those values above and put them side by side:

%time:~-11,2%%time:~-8,2%%time:~-5,2%

But like I said before, the hours can give you trouble because of the space. I came up with this code to pull off the space:

SET HOUR=%time:~-11,2%
Call :TRIM %HOUR%
GOTO :EOF
:TRIM
Set HOUR=%*
:EOF
REM You would use your trimmed hour right here
@echo %HOUR%

So, pulling it all together, how would we get an environment variable filled with a good date and time stamp filename?

Here is the code:
REM Get the hour first and put in an environment var

SET HOUR=%time:~-11,2%
Call :TRIM %HOUR%
GOTO :EOF
:TRIM
Set HOUR=%*
:EOF

REM Create our timestamp filename variable
SET DATESTMP=%date:~-4,4%%date:~-10,2%%date:~-7,2%%HOUR%
SET FILENAME=%DATESTMP%%time:~-8,2%%time:~-5,2%_DATA.ZIP

REM This is just an example call using our new filename
REM -=The real PKZIP program probably uses a different command line syntax
pkzip.exe c:\ImportantFolder\*.* c:\ZIPFILES\%FILENAME%

Using the code above, you can easily generate new files using the date and time in your batch script.

Original Article from www.networksteve.com

Written by Steve Wiseman on November 15th, 2009 with no comments.
Read more articles on BAT Files and Command Line and otherSoftware and Tools and Utility.

Network Administrator – Beta 4 Released

We are right on track with our beta – Network Administrator Beta 4 has been released.

You can get a copy of the beta from here:

Network Administrator Beta 4

As I wrote last week, we were working on the remote execute engine within Network Administrator. I am pleased to say that it is complete.

As a result of that implementation we were able to add two new plugins. They are:

Change Network Settings

Switch a computer to DHCP, or update the DNS Settings to different servers

Change Network Settings

Remote Execute

This allows you to remotely execute a vbscript, batch file, MSI installer (It automatically makes it quiet for you), or command line program. This is a very powerful addition, since it gives you the ability to create a script, and push it across all the machines on your network. One other point to note about this is that this will be faster than you doing this yourself from the command line using tools like PSExec. This is because Network Administrator will spawn more than one process at a time to accomplish your task.

Remote Execute Plugin

If you missed my post last week, we promised 10 plugins by the time we release on October 30th. In addition to the two I just discussed, here is what we have created so far:

Mass Folder Copy – This plugin allows you to pick a folder on your hard drive, and copy it to many machines across your network. Perfect way to copy a set of shortcuts to everyone’s desktop.

Offline Files Disabler – Disables the annoying offline files setting in Windows XP, and 2003.

Logon Disclaimer – Allows you to set a logon disclaimer that is displayed to a user before they login.

Wallpaper Set – You can set a common background wallpaper image, and set options such as tile, stretch, and center.

One of our next plugins will allow you to change the password of a local admin user account. It is easy to change an Active Directory user account, but when an admin leaves, you still have those local account passwords floating around. This would allow you to change it in a few moments – across your entire network.

Get your suggestion in by mailing us at plugins@intelliadmin.com We cannot answer all of the emails sent, but we do read them all.

Give it a spin, and let us know what you think.

Pre order your upgrade of Network Administrator 3.0 for only $99 (Includes a copy of 2.9)- Don’t wait – It will be $199 when it is released on October 30th. Click here to purchase

Written by Steve Wiseman on October 8th, 2009 with no comments.
Read more articles on Network Administrator and Command Line and otherSoftware and Beta.

Get Windows Update on a DVD

I was reading an article at PCMag about PatchMateXP. They have had all the patches for XP on one convenient CD.

Unfortunately for PatchMateXP, this breaks a license with Microsoft and they shut themselves down before they got into legal trouble.

This got me thinking – is there a way to get MS Updates on DVD or CD?

My findings were quite interesting.

After tons of digging, I found this Microsoft Knowledge base article: 913086

At that link, Microsoft provides ISO files that contain all of the security updates by month. They update it regularly.

This works fine if you are already patched up, and just need a few months. What if you need all of the patches for Vista, XP, or 2003? That won’t really help.

I dug some more, and I came across a free utility called Offline Update. You can download it from here.

It allows you to create an ISO file with patches for a specific version of Windows. It gets around those pesky legal issues by having you download the patches to generate the ISO file.

To use it, download the package from the above website, and extract it into a folder. In the root directory you will find a program named UpdateGenerator.exe

Launch it, and you will see that it has a simple, but effective interface:

Offline Update 6

It even includes patches for Office – a nice bonus.

Select the patches you want, and click start.

A command line window will popup and it will download for hours or days, but eventually it will finish.

When it completes, you will find the completed ISO file in the folder named ISO under the root:

Offline Update ISO

In my case it was the 64 bit version of 2003/XP patches.

Want to know the coolest part?

The ISO it builds is more than a collection of patches, it includes a custom program that will automatically install all of them in one shot.

Simply pop your burned DVD into the drive, and a window will show up:

Offline Update Program

Don’t be confused by the list of options, it is just giving you a choice on non-patch items included in the ISO.

If you just want the patches, simply select nothing and click start. It will only install the patches that have not been installed on your system:

Offline Install Patches

That is all there is to it. The program will install all of the patches, reboot, and the system is up to date.

Now, I can burn that ISO, and give it to my friend Brett, since he lives in an Internet dead zone.

This little utility can be a huge time saver. I highly recommend it.

Written by Steve Wiseman on September 16th, 2009 with no comments.
Read more articles on Command Line and ISO and otherSoftware and patches and Office and Windows.

Command line to Disable/Enable DHCP Client


For some security reasons for your Server to be offline from the network at any specific time or to prevent some computers on the network from accessing the internet, you can disable the DHCP (Dynamic Host Configuration Protocol) from the Service management console or using this command line.

-Command line to Disable DHCP Service:

echo off
net stop dhcp
sc config dhcp start= disabled
exit

-Command Line to Enable DHCP

echo off
sc config dhcp start= auto
net start dhcp

exit

You can copy  and paste into Notepad then save it as .bat

Posted in Command Line Tagged: ????????????????, Command Line, PC Tips, Windows

Written by Myhouse on August 24th, 2009 with no comments.
Read more articles on ???????????????? and PC Tips and Command Line and otherSoftware and Windows.

Install Windows updates on the command line and in scripts

Everybody knows that i'm a real fan of scripting :). I was really happy to read post of Michael Pietroforte about WuInstall 1.2 Pro... Continue at...

[[ This is a content summary only. Visit my website for full links, other content, and more! ]]


Written by magakos on June 4th, 2009 with no comments.
Read more articles on Command Line and otherSoftware and script and windows updates and WSUS.

How to Change a Computer Password Using Command Prompt


Ever thought of becoming an actual “hacker”? This article shows how to change a computer password and do other things using a command prompt. A command prompt is a command using the special built-in program that comes with every computer which allows you to do almost anything on a computer.

  1. Open Command Prompt. If you don’t know how, open the Start menu, go to Programs (or on Windows 2000 and up, all programs), go to Accessories, then you’ll see Command Prompt, click it.
  2. You’ll see a black screen pop up.
  3. Type in: “Net User”
  4. It will then show you a detailed little chart of all the User Accounts on the computer.
  5. Choose which account you want to hack.
  6. Say it says the user accounts are: Owner, Administrator, John, Alice, Christopher, and Guest.
  7. You choose Alice (Say you wanted to annoy your wife or girlfriend, I told you this would be a useful guide ;) ).
  8. Now type: “Net User Alice”, it’ll give you A LOT of information about the account. This step isn’t necessary, but it gives you information on other things you can do to the account, such as set it as innactive and delete it.
  9. Type in: “Net User Alice *” It’ll tell you to enter a password, then again to confirm it. This will both change the password or make a new one.
  10. Good Job! You’ve actually hacked an account! Now if Alice says anything, good luck with that, that’s in the article “How to Ignore an Annoying Wife or Girlfriend”… if it exists.
Posted in Command Line, How To   Tagged: How To, PC Tips   

Written by Myhouse on October 9th, 2008 with 3 comments.
Read more articles on PC Tips and Command Line and otherSoftware and how to.

« Older articles

No newer articles