Question:
How can i write a script in windows?
Devin
2010-06-14 13:02:34 UTC
I am new to this and am looking for a way to do basic operations in windows through a script. ( i don't care if this is a stupid idea i just want to know how to do it so i can work on from there) ie how could i write a script (a .bat file?) that could check to see if there were any updates for ...firefox... than display back to me if there were none or perform the update if there were some.
Four answers:
2010-06-14 13:04:19 UTC
You couldn't... Windows doesn't work that way, you'd have to cannibalize the source code to firefox and write your own lightweight version specifically for updating...
Rob
2010-06-14 13:28:02 UTC
You can script in Windows using VBScript (http://en.wikipedia.org/wiki/VBScript) and Windows Script Host (http://en.wikipedia.org/wiki/Windows_Script_Host). You can also use the newer Windows PowerShell (http://en.wikipedia.org/wiki/Windows_PowerShell).



Documentation/Guide for VBScript and WSH can be found at: http://www.microsoft.com/downloads/details.aspx?familyid=01592c48-207d-4be1-8a76-1c4099d7bbb9&displaylang=en



PowerShell Documentation Pack can be found at: http://blogs.msdn.com/b/powershell/archive/2006/11/30/powershell-documentation-pack.aspx



In your example of updating Firefox, it would be much easier if there was a way to update Firefox from the command line like you can in Linux. Using VBS, you could open Firefox and send keys to get to the Help->Check for Updates ... But you would run into problems reading the results. You'd probably be better off using VBS to get the current version of Firefox (it has commands for this), then compare that with the latest version available on the net. If the one on the net is newer, download and then do a silent install.
?
2016-11-29 10:31:35 UTC
there is not any trouble-free answer for this. First: itemizing c:abcd could be shared. 2d: This SMB proportion could be fixed interior the Linux /mnt itemizing interior the previous Perl is invoked. 0.33: For the 2d reason - Perl is the worst decision for this. it is done by skill of ability of becoming use of two strains in case you're taking good thing about bash script: smbmount //WindowsPcName/abcd /mnt -o username=guy or woman,password=pass,uid=500,... cp /mnt/xyz.log /var/pick/abc/xyz.log With Perl, that's relatively helpful to"T mount residing homestead homestead homestead windows/Samba proportion. the main appropriate you're arranged to do is to invoke those 2 strains with the Perl function "device" and wreck out the particular symbols the region/if necessary.
2010-06-14 13:03:40 UTC
Learn.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...