javascript - Windows Scripting: VBScript, DOS, JS, Python,- Stack Overflow

Say you were mainly a C-syntax like programmer and Linux systems administrator, and you were tasked wit

Say you were mainly a C-syntax like programmer and Linux systems administrator, and you were tasked with creating some simple automation tasks on Windows (monitoring of back-up files, process monitoring, ...). Which language would you prefer to write your scripts in? There's a large collection of VBS-scripts out there (using VB syntax), but I'd prefer anything more C-related.

What are your best experiences in using scripts for Windows? Any obvious down- or upside to a certain language?

Say you were mainly a C-syntax like programmer and Linux systems administrator, and you were tasked with creating some simple automation tasks on Windows (monitoring of back-up files, process monitoring, ...). Which language would you prefer to write your scripts in? There's a large collection of VBS-scripts out there (using VB syntax), but I'd prefer anything more C-related.

What are your best experiences in using scripts for Windows? Any obvious down- or upside to a certain language?

Share Improve this question edited May 6, 2009 at 17:57 Dan Lew 87.4k33 gold badges184 silver badges176 bronze badges asked Feb 13, 2009 at 15:04 MojahMojah 1,3732 gold badges12 silver badges16 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 7

I would use Powershell.

  • It has a vaguely C-like syntaxt.
  • It has an integrated shell.
  • The newest version (currently in CTP) includes a builtin IDE (Although it is limited pared to other 3rd party ones).
  • It has easy access to something like 90% of the functionality in the .Net framework.
  • Going forward, MS products will explicitly provide Powershell integration.
  • It supports pipes.

Pretty much every script in VBS can be converted to an equivalent in JScript.

There are a few gotchas to watch out for. Read up on the enumerator and remember that in VBS is case insensitive so when translating a script, certain methods may have the wrong casing.

Try to do what you want to do in a CMD-file, it that doesn't cut it, use Windows Scripting Host to call a wsh-file with JScript and/or VBScript in it. If you prefer the JScript-look, use that as your primary language, and use VBScript for things you copy from the net or cannot find a JScript solution to. You can call VBScript from JScript and the other way around.

Check out the Microsoft Scriptomatic tool too.

It can generate lots of admin scripts in VBScript, Perl, JavaScript (JScript) and Python. Makes navigating WMI much easier too.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1741857469a4370028.html

相关推荐

  • 国产之光!!让你的Docker管理更优雅!

    大家好,我是热爱开源的了不起!我们都知道,Docker是个好东西,能帮我们把应用打包成容器,方便部署和管理。但问题来了,Docker的命令行操作对新手来说有点复杂,一不小心就容易出错。而且,有时候我们只是想简单地管理一下容器,却得记住一堆命

    1小时前
    00
  • 面试官:从三万英尺角度谈一下Ceph架构设计(1)

    把面试官当陪练,在找工作中才会越战越勇大家好我是小义同学,这是大厂面试拆解——项目实战系列的第3篇文章,如果有误,请指正。本文主要解决的一个问题,Ceph为例子 如何描述项目的架构。一句话描述:主要矛盾发生变化10年前的技术和方案,放到10

    1小时前
    00
  • 如何打造高效AI智能体?

    作者|Barry Zhang, Anthropic地址|出品|码个蛋(ID:codeegg)整理|陈宇明最近看到了 Anthropic 那篇著名的《Building effective agents》作者之一 Barry Zhang 在 2

    1小时前
    00
  • 20 万 POC,直接拿来用,这不是测试,这是拒绝服务!!!

    之前看到很多人分享 github 上的一个项目,自动收录全网 nuclei 模板文件,目前已经 19 万了,如果直接拿来对目标进行漏洞探测,无疑会对目标造成巨大伤害,意味着可能要对目标发起十九万次请求以上,可以说是一次小型的 DDoS 攻击

    1小时前
    00
  • 电脑开机会默认一件GHOST

    关于电脑开机会自己重装系统 前段时间电脑一开机就遇到会自己ghost的问题,而且一直再重复同样的操作,我点击restart的时候到开启页面又会自动ghost,而且此页面停留

    1小时前
    00
  • 长读长测序揭示结直肠癌异常可变剪接图谱与新型治疗靶点

    徐州医科大学肿瘤研究所董东郑骏年教授团队在Genome Medicine杂志发表题为“Long-read sequencing reveals the landscape of aberrant alternative splicing

    1小时前
    00
  • ascend pytorch 踩坑.

    在910b上安装pytorch 和 pytorch_npu, 因为后续准备装vllm, 所以torch_npu是特殊的版本.代码语言:shell复制pip install torch==2.5.1 --extra-index pip in

    53分钟前
    00
  • Power BI 无公式实现帕累托图表

    帕累托分析(Pareto Analysis),也被称为8020法则、关键少数法则,是一种常用的管理工具,用于识别和处理影响业务的主要因素。看到李伟坚老师在Excel使用Vega实现了花式帕累托(参考:Excel 零公式实现高级帕累托图表)

    50分钟前
    00
  • 3、win10重装系统后Mysql环境和数据的恢复

    因为电脑是机哥的原因,重装了好几次电脑,因为我习惯把软件都装在D盘。所以很多东西都还比较好恢复,在网上学会了怎么不卸载重装数据库,自己记录以备后面自己查

    46分钟前
    00
  • UCB的硅光MEMS OCS控制技术

    昨天写的旭创与nEye合作了一个64端口硅光OCS一、光电路交换技术概述(一)电交换与分组交换电路交换的概念源于早期的电话交换机,通过物理连接实现设备间的通信,就像早期打电话时,接线员手动连接线路一样。而分组交换则是

    39分钟前
    00
  • 大模型驱动金融数据应用的实战探索

    近年来,人工智能技术的飞速发展正在重塑全球各行各业的生态格局,金融行业作为数据密集型领域,更是首当其冲。大模型凭借其强大的自然语言处理、逻辑推理和生成能力,逐渐成为金融数据应用的核心驱动力。本文将从行业背景与趋势、核心场景重构、产品能力提升

    33分钟前
    00
  • 在VMware虚拟机中安装Windows 7全攻略(避坑指南)

    ⚠️写在前面 最近发现很多开发者在调试老旧系统时都需要用到Windows 7环境(特别是银行、医疗等行业的遗留系统),但实体机安装既不现实也不安全。今天就手把手教你在虚拟机

    26分钟前
    00
  • Windows系统密钥检测工具PIDKey 2.1中文版

    Windows系统密钥检测工具PIDKey 2.1中文版 【下载地址】Windows系统密钥检测工具PIDKey2.1中文版 Windows系统密钥检测工具PIDKey 2.1中文版是一款功能强大的工具,专为管理Win

    21分钟前
    00
  • 雨晨 26200.5516 Windows 11 IoT 企业版 LTSC 2024 轻装版

    简述:以下为YCDISM (雨晨作品自2025年03月25日起通用介绍,若无重大更改不再额外敖述) 全程由最新YCDISM2025脱机装载26100.1742_zh-cn_windows_11_

    18分钟前
    00
  • Java&Activiti7实战:轻松构建你的第一个工作流

    本文已收录在Github,关注我,紧跟本系列专栏文章,咱们下篇再续!

    15分钟前
    00
  • windows切换系统版本

    powershell 管理员身份打开 输入 irm massgrave.devget | iex 输入数字 对应后面写着 change windows edition新的会话框中选择想要的版本即可 获取windows 密钥 官方提供的

    12分钟前
    00
  • 在Windows上使用MetaMCP的完整指南

    在当今AI助手工具快速发展的时代,如何有效管理各种MCP(Model Control Protocol)服务成为了一个挑战。MetaMCP应运而生,它是

    9分钟前
    00
  • 电子产品设计与电源优化实用策略

    产品降成本是商业活动中的常见行为,可贯穿于产品设计、研发、生产、运输、销售及维护的各个环节。然而,降成本策略必须建立在对产品品质要求不降低的基础上,确保设计参数满足要求并通过相关测试。以下是具体优化与深度分析。研发工程师通常从设计入手,选择

    6分钟前
    00
  • OpenAI“Agent 圣经”翻车?LangChain 创始人怒怼“全是坑”!

    整理 | Tina当前,AI 领域呈现出一种近乎“追星式”的热情氛围,每当有新的东西发布,便迅速引发广泛关注与高度评价,仿佛技术变革即将一触即发。同时大家情绪也波动剧烈,从“危机论”到“爆发论”频繁切换。OpenAI 最近出的《A Pra

    4分钟前
    00
  • 「全球首个自回归视频生成大模型」,刚刚,Swin Transformer作者创业团队重磅开源!

    机器之心编辑部视频生成领域,又出现一位重量级开源选手。今天,马尔奖、清华特奖得主曹越的创业公司 Sand AI 推出了自己的视频生成大模型 ——MAGI-1。这是一个通过自回归预测视频块序列来生成视频的世界模型,生成效果自然流畅,还有多个版

    2分钟前
    00

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信