•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 428,211 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,186 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 713 | Replies: 6
![]() |
•
•
Join Date: Jul 2008
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
Hi Everyone,
Is it possible to convert a .sh script to VBS? If so, how should I go about this pls?
The issue is that i have found a script which does exactly what i need, but it is written as a .sh we are a pure windows shop and have very little experience with Unix boxes.... so somehow converting this to VBS would be great...
Thanks,
Stuart.
Is it possible to convert a .sh script to VBS? If so, how should I go about this pls?
The issue is that i have found a script which does exactly what i need, but it is written as a .sh we are a pure windows shop and have very little experience with Unix boxes.... so somehow converting this to VBS would be great...
Thanks,
Stuart.
•
•
Join Date: Oct 2007
Posts: 275
Reputation:
Rep Power: 1
Solved Threads: 26
I don't think there's any product out there that will do this for you automatically, at least I couldn't find one.
You'll probably have to do a straight-up port on your own. If you can post the script here (not too long and I'm not asking for you to reveal confidential info), perhaps I - or someone else here - might be able to help you.
Also, check the guidelines for this forum, you might get better help in the "Visual Basic" or "VB.Net" forums with regards to this.
Best wishes,
Mike
You'll probably have to do a straight-up port on your own. If you can post the script here (not too long and I'm not asking for you to reveal confidential info), perhaps I - or someone else here - might be able to help you.
Also, check the guidelines for this forum, you might get better help in the "Visual Basic" or "VB.Net" forums with regards to this.
Best wishes,
Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
•
•
Join Date: Apr 2008
Posts: 39
Reputation:
Rep Power: 1
Solved Threads: 8
The best thing to do would be to find someone who is fluent in both vbs and shell scripting in order to have them convert the script for you. This may cost some money, especially depending on the size of the project.
The thing of it is, is that most windows scripting languages are very task oriented - there are certain aspects of the operating system that a particular scripting language is meant to be used for administrating. Shell scripting on the other hand is simply a collection of tools that are available on almost all *nix distributions, bound together by an interpreter (whether it be ksh, csh, sh, or awk). There really aren't a lot of limitations there. The windows script host is an interface to the graphical options that are available in windows - whereas the graphical interface for *nix distributions are an interface to the shell commands.
I can certainly help you with this task, as I am a confident programmer with both languages (in fact, shell scripting and vbscript are my two specialties). Depending on your own ability, you may be able to do it yourself as well. Elaborate on how involved this script will be - the number of lines of code, the aim of the script, etc. and someone can give you an idea of what it is going to take - but you certainly will not find an automatic translator.
The thing of it is, is that most windows scripting languages are very task oriented - there are certain aspects of the operating system that a particular scripting language is meant to be used for administrating. Shell scripting on the other hand is simply a collection of tools that are available on almost all *nix distributions, bound together by an interpreter (whether it be ksh, csh, sh, or awk). There really aren't a lot of limitations there. The windows script host is an interface to the graphical options that are available in windows - whereas the graphical interface for *nix distributions are an interface to the shell commands.
I can certainly help you with this task, as I am a confident programmer with both languages (in fact, shell scripting and vbscript are my two specialties). Depending on your own ability, you may be able to do it yourself as well. Elaborate on how involved this script will be - the number of lines of code, the aim of the script, etc. and someone can give you an idea of what it is going to take - but you certainly will not find an automatic translator.
•
•
Join Date: Jul 2008
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
Here is a copy of the .sh script... the idea is that it updates the configuration of Dell remote access cards which are in-built into Dell servers.
I would greatly appriciate some help, I have zero vbs skills... : (
+++++++++++++++++
I would greatly appriciate some help, I have zero vbs skills... : (
+++++++++++++++++
#!/bin/bash # File containing a list of IP address - one in each line ipfile=ipaddr.txt # This is the drac configuration file which contains the configuration. dracconfigfile=drac.cfg # Logfile to store the logs of the execution logfile=config.log # RACADM command to be executed racadm_command="racadm -u root -p password" if [ ! -r $ipfile ]; then echo "IP address file $ipfile not found or cannot be read" exit fi if [ ! -r $dracconfigfile ]; then echo "DRAC configuration file $dracconfigfile not found or cannot be read" exit fi # Logfile gets overwritten everytime this script is executed echo "Starting batch configuration of DRAC from file $ipfile" > $logfile while read line; do # Ingnore blank lines [ -z "$line" ] && continue # Ingnore comments (lines with a ;) echo $line | grep "^;" > /dev/null [ $? -eq 0 ] && continue echo Configuring DRAC at ip address: $line echo "========================================" >> $logfile echo "DRAC IP = $line" >> $logfile echo y | $racadm_command -r $line config -f drac.cfg >> $logfile 2>&1 if [ $? -ne 0 ]; then echo "Failed. See logfile for details" else echo "DRAC configured successfully" fi done < $ipfile echo Done ++++++++++++++++++++ From this point on it is the Drac.cfg file data... [idRacInfo] # idRacType=6 # idRacProductInfo=Dell Remote Access Controller 5 # idRacDescriptionInfo=This system component provides a complete set of remote management functions for Dell PowerEdge servers # idRacVersionInfo=1.33 # idRacBuildInfo=08.07.11 # idRacName=DRAC 5 # To change username or password for a user # Note: cfgUserAdminIndex line should be commented [cfgUserAdmin] # cfgUserAdminIndex=4 cfgUserAdminUserName=username cfgUserAdminPassword=password [cfgUserAdmin] # cfgUserAdminIndex=5 cfgUserAdminUserName=username cfgUserAdminPassword=password [cfgUserAdmin] # cfgUserAdminIndex=6 cfgUserAdminUserName=username cfgUserAdminPassword=password # For more users copy paste the entire sections # To add and enable a user use the section below [cfgUserAdmin] # cfgUserAdminIndex=9 cfgUserAdminUserName=username cfgUserAdminPassword=password cfgUserAdminPrivilege=0x00000000 cfgUserAdminIpmiLanPrivilege=15 cfgUserAdminIpmiSerialPrivilege=15 cfgUserAdminSolEnable=0 cfgUserAdminEnable=1 # To configure Active directory uncomment these lines # and edit the values # [cfgActiveDirectory] # cfgADEnable=0 # cfgADRacDomain=ourplace.org.au # cfgADRootDomain=ourplace.org.au # cfgADRacName=testdrac # cfgADAuthTimeout=120 # cfgADType=1 # cfgADSmartCardLogonEnable=0 # cfgADCRLEnable=0 # cfgADSpecifyServerEnable=0 # cfgADDomainController=0.0.0.0 # cfgADGlobalCatalog=0.0.0.0 # cfgAODomain=0.0.0.0 # [cfgStandardSchema] # cfgSSADRoleGroupIndex=1 # cfgSSADRoleGroupName=dracgrp # cfgSSADRoleGroupDomain=ourplace.org.au # cfgSSADRoleGroupPrivilege=0x000001ff
Last edited by Tekmaven : Jul 22nd, 2008 at 6:41 pm. Reason: Code tags
•
•
Join Date: Apr 2008
Posts: 39
Reputation:
Rep Power: 1
Solved Threads: 8
The text is available, it was just a bit hard to read because you hadn't enclosed it in code tags.
It doesn't look like an overly complicated script - though I wonder if you have racadm installed? Then whether or not it has a command line utility on windows as well as on *nix. I'd have to look into that a bit.
It doesn't look like an overly complicated script - though I wonder if you have racadm installed? Then whether or not it has a command line utility on windows as well as on *nix. I'd have to look into that a bit.
•
•
Join Date: Jul 2008
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
Hi There,
The racadmin utility will only install an a machine with a Dell remote access card installed... it is just the way Dell have written the application.
More infor can be found here:
http://en.wikipedia.org/wiki/Dell_DRAC#Remote_console
Thanks,
Stuart.
The racadmin utility will only install an a machine with a Dell remote access card installed... it is just the way Dell have written the application.
More infor can be found here:
http://en.wikipedia.org/wiki/Dell_DRAC#Remote_console
Thanks,
Stuart.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Does .vbs files accept vb.net code? (VB.NET)
- .vbs file (Visual Basic 4 / 5 / 6)
- can not find script file "C:\achi.dll.vbs" (Viruses, Spyware and other Nasties)
- Editing Registry with VBS (Visual Basic 4 / 5 / 6)
- VBS script to map drives via AD 2003 (Visual Basic 4 / 5 / 6)
- Trojan-Downloader.VBS.Psyme.v. virus (Viruses, Spyware and other Nasties)
- Backdoor-ciu & Vbs/pyfe (Viruses, Spyware and other Nasties)
Other Threads in the Shell Scripting Forum
- Previous Thread: Color first line of results
- Next Thread: print only the last entry of the file


Linear Mode