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.
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.
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
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"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
regards
Chandru