Go Back   PCMech Forums > Windows Support > Windows Legacy Support (XP and earlier)

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 05-19-2008, 08:50 PM   #1
Member (3 bit)
 
Join Date: May 2008
Posts: 4
Windows Batch Files?

Hi Everybody,

I am trying to script a batch file to run chkdsk on demand. This would be exectuted manually on a remote computer when I execute the script.

echo y | chkdsk c: /f /r /x && restart -r -t 5

When I do this it won't execute the reboot, it just stalls and execute only the first command.

Thanks in advance for any assistance,
mizzfit
mizzfit is offline   Reply With Quote
Old 05-20-2008, 06:21 AM   #2
Ride 'em Cowboy
 
EzyStvy's Avatar
 
Join Date: Dec 1999
Location: Dallas, Tx
Posts: 9,018
Need to replace the word reboot with Shutdown.exe

Creating a Shutdown/Reboot Icon


WindowsXP has a program called SHUTDOWN.EXE which allows you to easily create icons to shutdown or restart your computer.

To create a shutdown shortcut on the desktop:

Right click on an open area of the desktop
Select New / Shortcut
Enter in "shutdown -s -t 00" - no quotes
Press the Next button
For the name, enter in anything you like. I just use shutdown. Click on the Finish button.
For a reboot, enter "shutdown -r -t 00"

Shutdown [{-l|-s|-r|-a}] [-f] [-m [\\ComputerName]] [-t xx] [-c "message"] [-d[u][p]:xx:yy]

Parameters

-l - Logs off the current user, this is also the defualt. -m ComputerName takes precedence.
-s - Shuts down the local computer.
-r - Reboots after shutdown.
-a - Aborts shutdown. Ignores other parameters, except -l and ComputerName. You can only use -a during the time-out period.
-f - Forces running applications to close.
-m [\\ComputerName] - Specifies the computer that you want to shut down.
-t xx - Sets the timer for system shutdown in xx seconds. The default is 20 seconds.
-c "message" - Specifies a message to be displayed in the Message area of the System Shutdown window. You can use a maximum of 127 characters. You must enclose the message in quotation marks.
__________________
Stand Up 2 Cancer - SU2C
EzyStvy is offline   Reply With Quote
Old 05-20-2008, 07:51 AM   #3
Member (3 bit)
 
Join Date: May 2008
Posts: 4
thanks for the reply, i did have that but obviosuly i didnt post that. It executes the command properly and doesnt run the second command.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\rrood>cd Desktop

C:\Documents and Settings\rrood\Desktop>chkd.bat

C:\Documents and Settings\rrood\Desktop>echo y | chkdsk c: /f /r /x && shutd
own -r -t 00
The type of the file system is NTFS.
Cannot lock current drive.

Chkdsk cannot run because the volume is in use by another
process. Would you like to schedule this volume to be
checked the next time the system restarts? (Y/N)
This volume will be checked the next time the system restarts.

C:\Documents and Settings\rrood\Desktop>

and then it just doesnt restart.
mizzfit is offline   Reply With Quote
Old 05-20-2008, 07:59 AM   #4
Ride 'em Cowboy
 
EzyStvy's Avatar
 
Join Date: Dec 1999
Location: Dallas, Tx
Posts: 9,018
Post the entire batch file

Does it start with CMD to get you to a cmd promt?
EzyStvy is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Online Windows Media Files won't play StephenC Internet, Web Applications, & The Cloud 15 11-15-2007 08:46 PM
Primary hard Drive O not found... pullin my hair out!! lynnspayne Computer Hardware 12 04-01-2006 11:04 AM
32 or 64 bit xp????? john ranger Windows Legacy Support (XP and earlier) 11 07-13-2003 07:22 PM
Need help with Windows tweak hoemee Windows Legacy Support (XP and earlier) 5 04-25-2002 02:46 PM
Windows XP, are you ready? reboot General Discussion 59 11-06-2001 07:54 AM


All times are GMT -5. The time now is 04:52 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0