Link to home
Start Free TrialLog in
Avatar of expertblr
expertblr

asked on

Script file to be made as .bat file

Hi,
I have vb script which disables usb, cd rom and floppy drive by editing registry.

I need to do some thing like i want to make it as a .bat and if i run that .bat file in any of the machine the script should execute or run and disable the usb,cd and floppy.

Dont give me any of the link, just tell me how to do that.
Avatar of chandru_sol
chandru_sol
Flag of India image

Can you post your vbscript so that we can convert the same to bat?

regards
Chandru
Avatar of Jeroen Rosink
Why not call your vbs script using a bat file.

could be something like:
1. open notepad
2. past the path and filename of your vbs script like: C:\temp\test.vbs
3. save file as your bat-file

regards,
Jeroen
I don't know the actual Registry Key and Values you need to set, but this is how you do it.  Use a bat file that writes a registry file, then silently imports it, and delete the registry file:
@Echo Off
 
:Create Temp Registry File
> "%Temp%\regfix.reg" ECHO Windows Registry Editor Version 5.00 
>> "%Temp%\regfix.reg" ECHO.
 
:Add Registry Key to Our Temp File
>> "%Temp%\regfix.reg" ECHO [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run] 
 
:Set Value For Above Key in Temp File
>> "%Temp%\regfix.reg" ECHO "CDROM"="disable"
 
:Import Our Temp Registry File
REGEDIT /S "%Temp%\regfix.reg"
 
:Delete Our Temp Registry File
DEL "%Temp%\regfix.reg"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of bsharath
bsharath
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial