Simple tasks by Batch file or Scripting technique 
Author Message
 Simple tasks by Batch file or Scripting technique

Folks:

I would like to do a number of small tasks using a DOS batch file or some Scripting technique.  I would prefer not to have to respond to any prompts during the running of these commands.

Here we go:

*   Run the CONVERT command to QUIETLY convert the the File System from FAT32 to NTFS.  
*   Change the drive letter of the CD ROM from D to Z
*   Set the TimeZone to Eastern
*   Set the ProxyException parameter of Microsoft's IE browser to:  zintrab;108.*
*   Set the Proxy parameter of Microsoft's IE browser to:  Proxy.Mycompany.com

I would appreciate and suggested Links or direct answers.  Thanks in advance.

Cheers,
John.



Fri, 01 Jul 2005 05:15:57 GMT  
 Simple tasks by Batch file or Scripting technique

Quote:

> I would like to do a number of small tasks using a DOS batch file
> or some Scripting technique.  I would prefer not to have to
> respond to any prompts during the running of these commands.

I assume Win2k or better

Quote:
>  Here we go:

>  *   Run the CONVERT command to QUIETLY convert the the File
>      System from FAT32 to NTFS.

CONVERT.EXE asks for the volume label if one exists, and also asks to confirm
converting a drive it cannot gain exclusive access to. One prerequisite for
making this command unattended is that only one of those two conditions are
present. I assume that you want to convert the disk where the OS is installed,
in that case you can't have a volume label on the disk.

Command that handles the exclusive access question:

%comspec% /c echo y|convert.exe c: /FS:NTFS

Quote:
>  *   Change the drive letter of the CD ROM from D to Z

This can be done by manipulating the values under HKLM\SYSTEM\MountedDevices

WMI\VBScript solution:
http://www.*-*-*.com/ %40hydro.com

Command line reg.exe solution
http://www.*-*-*.com/

Quote:
>  *   Set the TimeZone to Eastern

Not easy, well you can resort to a SendKeys solution sort of, but if wouldn't be
the safest thing here in the world ;-)

Anyway, you can open the Time/Date applet so it is quick to do it manually:

rundll32.exe shell32.dll\,Control_RunDLL TIMEDATE.CPL

If you want to automate the keyboard input necessary to select the Eastern
TimeZone, take a look at AutoIt.exe or AutoItX.dll (free)
http://www.*-*-*.com/

AutoIt.exe is a standalone script "engine", while AutoItX is an ActiveX control
version of AutoIt and can be used from VBScript/JScript.

Quote:
>  *   Set the ProxyException parameter of Microsoft's IE browser
>      to:  zintrab;108.*
>  *   Set the Proxy parameter of Microsoft's IE browser to:
>      Proxy.Mycompany.com

Update the registry values ProxyOverride and ProxyServer under

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings

This can be done with a simple registry file, import it unattended with "regedit
/s <path_to_reg_file>", or use reg.exe, or the RegWrite method in WSH
(VBScript\JScript)

Please, next time, ease up on the cross-posting and post to relevant groups :-)
I wouldn't be sad if you dropped the html as well ;-)

If you ask me the following groups are pretty irrelevant when it comes to your
above questions:

microsoft.public.scripting.hosting
microsoft.public.scripting.de{*filter*}
microsoft.public.scripting.remote
microsoft.public.scripting.scriptlets
microsoft.pub ??  The list got to long I guess ;-)

This two groups would fit better to the bill really:

microsoft.public.scripting.wsh
microsoft.public.win2000.cmdprompt.admin

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and a ONLINE version of the 1328 page
Scripting Guide: http://www.*-*-*.com/



Fri, 01 Jul 2005 09:59:43 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Simple tasks by Batch file or Scripting technique

2. How to run a simple batch login script VB4

3. Batch technique

4. Simple Task...a text file...please help

5. File compression techniques (was: Antw: file compression)

6. A Simple Script to reformat messy Scripts

7. Simple Script Please Help - No Knowledge of scripting

8. HELP! Call Script from a batch file

9. Running a Batch File from a Script

10. Logon Script - Launched from BATCH file.

11. calling a batch file from script

 

 
Powered by phpBB® Forum Software