New Posts  All Forums:Forum Nav:

Help with batch file

post #1 of 5
Thread Starter 
I use a batch file, here at work, that removes folders from specified computers via IP.

That's all fine and dandy, however, I would like a command window to pop up and ask which computer(s) need these folders gone.

Here is what I use currently;
Code:
RMDIR /S /Q \\169.161.175.87\C$\Progra~1\Hewlet~1\CM\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\J2SERE~1
RMDIR /S /Q \\169.161.175.87\C$\Progra~1\Hewlet~1\CM\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\JRE_16~1
RMDIR /S /Q \\169.161.175.87\C$\Progra~1\Hewlet~1\CM\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\IEXPLO~1
RMDIR /S /Q \\169.161.175.87\C$\Progra~1\Hewlet~1\CM\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\IECUST~1
REM

RMDIR /S /Q \\169.161.175.87\C$\Progra~1\Hewlet~1\HPCA\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\J2SERE~1
RMDIR /S /Q \\169.161.175.87\C$\Progra~1\Hewlet~1\HPCA\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\JRE_16~1
RMDIR /S /Q \\169.161.175.87\C$\Progra~1\Hewlet~1\HPCA\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\IEXPLO~1
RMDIR /S /Q \\169.161.175.87\C$\Progra~1\Hewlet~1\HPCA\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\IECUST~1
REM


//Change CM to HPCA if no files/folders found.

I would like to change it so that it asks me, A) Are multiple computers being worked on? and B) IP addresses for all affected.

If you must know, IE gets royally messed up when a software profile is installed onto a newly imaged machine. It requires us to remove specified folders and reinstall the basic software profile.

The reason that the remove function is listed twice is that the folder tree could be in one or the other, however, never in both.
    
CPUMotherboardGraphicsRAM
Q8400 DFI LP DK P45-T2RS eVGA GTX 650 Kingston 
Hard DriveOptical DriveOSMonitor
2.8TB Total LG Super DVD Burner SATA VII Enterprise x64 Gateway FHD2401 
PowerCaseMouseMouse Pad
Corsair VX550W NZXT Source 210 White Logitech G400 Razer Kabuto 
Audio
Creative Audigy 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q8400 DFI LP DK P45-T2RS eVGA GTX 650 Kingston 
Hard DriveOptical DriveOSMonitor
2.8TB Total LG Super DVD Burner SATA VII Enterprise x64 Gateway FHD2401 
PowerCaseMouseMouse Pad
Corsair VX550W NZXT Source 210 White Logitech G400 Razer Kabuto 
Audio
Creative Audigy 
  hide details  
Reply
post #2 of 5
Not to discourage you or anything but:
1. What OS?
2. Programming and scripting are slightly different
SolusIgnis
(21 items)
 
2 Watts
(6 items)
 
Huh?!
(13 items)
 
CPUCPUCPUMotherboard
i7-3820 Xeon Phi 31S1P Copressor (WIP) Xeon Phi 31S1P Copressor (WIP) ASRock X79 Extreme6 
GraphicsRAMHard DriveCooling
XFX Reference 6950 Samsung Magic RAM Crucial M4 Cosair H80 
OSMonitorMonitorMonitor
Windows 8.1 Pro HannSpree HF205 1600x900 ASUS VH239H 1920x1080 ASUS VH239H 1920x1080 
KeyboardCaseMouseMouse Pad
CMStorm Quick Fire Pro, Cherry MX Blue Thermaltake Oversoar RX-I MadCatz RAT 9 Saitek Cyborg V.5 
OtherOtherOther
Thrustmaster HOTAS Warthog TrackIR 5 Saitek Pro Combat Pedals 
CPUMotherboardRAMHard Drive
Marvell PXA510 D2Plug DDR3 
Optical DriveCooling
Pssh! Who needs optical drives Passive 
CPUOS
i386 MS-DOS 
  hide details  
Reply
SolusIgnis
(21 items)
 
2 Watts
(6 items)
 
Huh?!
(13 items)
 
CPUCPUCPUMotherboard
i7-3820 Xeon Phi 31S1P Copressor (WIP) Xeon Phi 31S1P Copressor (WIP) ASRock X79 Extreme6 
GraphicsRAMHard DriveCooling
XFX Reference 6950 Samsung Magic RAM Crucial M4 Cosair H80 
OSMonitorMonitorMonitor
Windows 8.1 Pro HannSpree HF205 1600x900 ASUS VH239H 1920x1080 ASUS VH239H 1920x1080 
KeyboardCaseMouseMouse Pad
CMStorm Quick Fire Pro, Cherry MX Blue Thermaltake Oversoar RX-I MadCatz RAT 9 Saitek Cyborg V.5 
OtherOtherOther
Thrustmaster HOTAS Warthog TrackIR 5 Saitek Pro Combat Pedals 
CPUMotherboardRAMHard Drive
Marvell PXA510 D2Plug DDR3 
Optical DriveCooling
Pssh! Who needs optical drives Passive 
CPUOS
i386 MS-DOS 
  hide details  
Reply
post #3 of 5
Thread Starter 
XP.

I didn't know where else to create this topic.
    
CPUMotherboardGraphicsRAM
Q8400 DFI LP DK P45-T2RS eVGA GTX 650 Kingston 
Hard DriveOptical DriveOSMonitor
2.8TB Total LG Super DVD Burner SATA VII Enterprise x64 Gateway FHD2401 
PowerCaseMouseMouse Pad
Corsair VX550W NZXT Source 210 White Logitech G400 Razer Kabuto 
Audio
Creative Audigy 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q8400 DFI LP DK P45-T2RS eVGA GTX 650 Kingston 
Hard DriveOptical DriveOSMonitor
2.8TB Total LG Super DVD Burner SATA VII Enterprise x64 Gateway FHD2401 
PowerCaseMouseMouse Pad
Corsair VX550W NZXT Source 210 White Logitech G400 Razer Kabuto 
Audio
Creative Audigy 
  hide details  
Reply
post #4 of 5
Code:
@ECHO OFF
SET /P INPUT="What IP to RMDIR: "

RMDIR /S /Q \\%INPUT%\C$\Progra~1\Hewlet~1\CM\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\J2SERE~1
RMDIR /S /Q \\%INPUT%\C$\Progra~1\Hewlet~1\CM\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\JRE_16~1
RMDIR /S /Q \\%INPUT%\C$\Progra~1\Hewlet~1\CM\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\IEXPLO~1
RMDIR /S /Q \\%INPUT%\C$\Progra~1\Hewlet~1\CM\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\IECUST~1
REM

RMDIR /S /Q \\%INPUT%\C$\Progra~1\Hewlet~1\HPCA\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\J2SERE~1
RMDIR /S /Q \\%INPUT%\C$\Progra~1\Hewlet~1\HPCA\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\JRE_16~1
RMDIR /S /Q \\%INPUT%\C$\Progra~1\Hewlet~1\HPCA\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\IEXPLO~1
RMDIR /S /Q \\%INPUT%\C$\Progra~1\Hewlet~1\HPCA\Agent\Lib\SYSTEM\OVCM\SOFTWARE\ZSERVICE\IECUST~1
REM


//Change CM to HPCA if no files/folders found.

Your Welcome
 
Tragbar
(14 items)
 
 
CPUMotherboardGraphicsRAM
Ryzen 1800X Asus Crosshair VI Hero Nvidia Geforce Titan X F4-3600C15D-16GTZ 
Hard DriveHard DriveHard DriveHard Drive
Combined: 6.13 TB of space Samsung SSD 960 EVO 500GB Crucial_CT1050MX300SSD1 M4-CT128M4SSD2 
CoolingCoolingCoolingCooling
EK-Supremacy EVO White Edition PrimoChill PrimoFlex Advanced LRT EK-RES X4 250 (R2.0) Reservoir EK-CoolStream XE 360 
CoolingCoolingCoolingOS
EK-Vardar F4-120ER (2200rpm)  EK-Ekoolant EVO Liquid Coolant EK-XTOP Revo D5 PWM Pump Windows 10 Pro 
MonitorKeyboardPowerCase
Asus VG278H Ducky YOTG Keyboard Corsair AX1200 Corsair Obsidian 800D 
MouseAudioAudioAudio
Logitech G700s Schiit Gungnir Multibit Schiit Mjolnir 2 Schiit LISST 
Audio
Audeze LCD 2 - pre fazor 
CPUMotherboardGraphicsRAM
intel i7 4770K ASRock Z87E-ITX Nvidia Geforce GTX Titan X GSkill F3-2400C10D-16GTX R 
Hard DriveOptical DriveCoolingOS
Samsung 840 Pro 512GB Silverstone 12.7mm Slot Load Blu-Ray Burner Noctua NH-L12 Windows 8 Pro 
MonitorCaseAudioAudio
LG PA75U Slim LED Projector Silverstone SG08 Schiit Bifrost Schiit Asgard 2 
AudioOther
AKG Q701 Headphones Pelican 1510 Green Case  
  hide details  
Reply
 
Tragbar
(14 items)
 
 
CPUMotherboardGraphicsRAM
Ryzen 1800X Asus Crosshair VI Hero Nvidia Geforce Titan X F4-3600C15D-16GTZ 
Hard DriveHard DriveHard DriveHard Drive
Combined: 6.13 TB of space Samsung SSD 960 EVO 500GB Crucial_CT1050MX300SSD1 M4-CT128M4SSD2 
CoolingCoolingCoolingCooling
EK-Supremacy EVO White Edition PrimoChill PrimoFlex Advanced LRT EK-RES X4 250 (R2.0) Reservoir EK-CoolStream XE 360 
CoolingCoolingCoolingOS
EK-Vardar F4-120ER (2200rpm)  EK-Ekoolant EVO Liquid Coolant EK-XTOP Revo D5 PWM Pump Windows 10 Pro 
MonitorKeyboardPowerCase
Asus VG278H Ducky YOTG Keyboard Corsair AX1200 Corsair Obsidian 800D 
MouseAudioAudioAudio
Logitech G700s Schiit Gungnir Multibit Schiit Mjolnir 2 Schiit LISST 
Audio
Audeze LCD 2 - pre fazor 
CPUMotherboardGraphicsRAM
intel i7 4770K ASRock Z87E-ITX Nvidia Geforce GTX Titan X GSkill F3-2400C10D-16GTX R 
Hard DriveOptical DriveCoolingOS
Samsung 840 Pro 512GB Silverstone 12.7mm Slot Load Blu-Ray Burner Noctua NH-L12 Windows 8 Pro 
MonitorCaseAudioAudio
LG PA75U Slim LED Projector Silverstone SG08 Schiit Bifrost Schiit Asgard 2 
AudioOther
AKG Q701 Headphones Pelican 1510 Green Case  
  hide details  
Reply
post #5 of 5
Thread Starter 
Many thanks!

Is there a way to loop it, so that I can enter another (or more) IP addresses from the same command window?

EDIT:

I made it loop using the example here.
Edited by legoman786 - 2/17/12 at 8:46am
    
CPUMotherboardGraphicsRAM
Q8400 DFI LP DK P45-T2RS eVGA GTX 650 Kingston 
Hard DriveOptical DriveOSMonitor
2.8TB Total LG Super DVD Burner SATA VII Enterprise x64 Gateway FHD2401 
PowerCaseMouseMouse Pad
Corsair VX550W NZXT Source 210 White Logitech G400 Razer Kabuto 
Audio
Creative Audigy 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q8400 DFI LP DK P45-T2RS eVGA GTX 650 Kingston 
Hard DriveOptical DriveOSMonitor
2.8TB Total LG Super DVD Burner SATA VII Enterprise x64 Gateway FHD2401 
PowerCaseMouseMouse Pad
Corsair VX550W NZXT Source 210 White Logitech G400 Razer Kabuto 
Audio
Creative Audigy 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming