Go Premium for a chance to win a PS4. Enter to Win

x

Windows Batch

11K

Solutions

11K

Contributors

Batch files are text files containing a script of commands that are executed by the command interpreter on DOS, OS/2 and Windows systems. Most commonly, they are used to perform a series of functions that are repeated -- copying a set of files created daily with one step, for example.

Share tech news, updates, or what's on your mind.

Sign up to Post

I am trying to convert a .bat file to a VBScript file for convenience.  I have been able to convert all parts, except the following:

Echo DateTime=%DATE%, %TIME% > "networklocation\System.log"
Echo USERDOMAIN=%USERDOMAIN%\%USERDNSDOMAIN% >> "networklocation\System.log"
Echo COMPUTERNAME=%COMPUTERNAME% >> "networklocation\System.log"
Echo USERNAME=%USERNAME% >> "networklocation\System.log"
ipconfig >> "networklocation\System.log"
systeminfo | find /I "tImE" >> "networklocation\System.log"

Open in new window


I understand that this is appending the data to a log file, but I don't know how to write the "Echo", "ipconfig", and "systeminfo" commands in VBScript.  Any help is appreciated.
0
Free Tool: Subnet Calculator
LVL 11
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Hi Experts,
We have multipal windows system in network, in BOD process we need to copy some files in every systems manually, its a time taking process for me. Please suggest any bat (automatic) process to short out this trouble. Every systems having user name & password.
0
I need someone  who are doing very well with batch scripts
then i will explain short and clear
thank you!
0
I cannot for the life of me get a bat file to run through GPO. I have stored the file on the file server in a public share, in netlogon on the DC, in the actual script folder within the policy object, ran with various switches. I have also used another bat file to call the actual bat file. The bat file will run fine manually, but not when logging on. This is a script provided by the software company used for installing one component. Any tips?
0
how to run this command with cmd.exe?
this:
FOR %a in (*.dll *.exe *.bat *.txt *.md) do (echo.>%a:Zone.Identifier)

Open in new window

0
Converting ANSI to UTF8 through Command, For one Field value, Space is getting converted to Carriage return, What I am missing. Please help experts.

<Command Used>
PowerShell -Command "Get-Content 'ANSI_File' | Set-Content -Encoding UTF8 'UTF8_File'"

<Example>
Field Value (ANSI) (Space was there before %s)
abcdefghijk: %s|(abcdefgh)|(ijklmnop)

Field Value (UTF-8) (Converted to Carriage Return before %s)
abcdefghijk:  %s|(abcdefgh)|(ijklmnop)
0
I'm wanting to create a batch file that will check for the existence of a device name like 'PowerMIC%' before running a program.  I'm able to run the command  " wmic path CIM_LogicalDevice where "Name like 'PowerMIC%'" get /value " which shows lots of data if the device is present or " No Instance(s) Available. " if the mic isn't plugged into the USB port ....

Any thoughts on easily doing this .....   I'm not very proficient at batch files  .....

Joel
0
Hello folks,
i have created the following script to remove profiles from PCs, however what change would i make to skip the administrator profile?

$CLIENT = Get-Content "c:\Temp\computers.txt"
 
foreach($PC in $CLIENT){
    # Testing PC connectivity
    if(Test-Connection $PC -Count 1 -Quiet){
        # Gathering users from c:\users
        foreach($PCuser in (Get-ChildItem "\\$pc\c$\users" -Directory)){
            # delete  recursively
            RD "\\$PC\c$\Users\$($pcuser.name)\Desktop\*.*"
            RD "\\$PC\c$\Users\$($pcuser.name)\Downloads\*.*"
            RD "\\$PC\c$\Users\$($pcuser.name)\Documents\*.*"
            RD "\\$PC\c$\Users\$($pcuser.name)\Music\*.*"
            RD "\\$PC\c$\Users\$($pcuser.name)\Pictures\*.*"
            RD "\\$PC\c$\Users\$($pcuser.name)\Videos\*.*"
        }
    }else{
        Write-Warning "$PC is offline"
    }
} 

Open in new window


or if anybody has a a batch that'd be great too

Thanks for looking
0
here the link:https://github.com/quarkslab/quarkspwdump
and here the usage:
quarks-pwdump.exe <options>
	Options : 
	-dhl  --dump-hash-local
	-dhdc --dump-hash-domain-cached
	-dhd  --dump-hash-domain (NTDS_FILE must be specified)
	-db   --dump-bitlocker (NTDS_FILE must be specified)
	-nt   --ntds-file FILE
	-hist --with-history (optional)
	-t    --output-type JOHN/LC (optional, if no=>JOHN)
	-o    --output FILE (optional, if no=>stdout)
	Example: quarks-pwdump.exe --dump-hash-domain --with-history

Open in new window



i can't see anywere ''quarks-pwdump.exe''
0
Hello,

As the title says. Just trying to run a VBScript to change the tab in an IE window every 10 seconds. My code is:

Set WshShell = WScript.CreateObject("WScript.Shell")

i = 0

Do While i = 0
      WshShell.AppActivate "Internet Explorer"
      Wscript.Sleep 10
      WshShell.SendKeys "^{TAB}"
        Wscript.Sleep 1000
Loop


Not sure whats wrong but it just won't run correctly.
0
How to Use the Help Bell
LVL 11
How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Command Prompt - Scheduled jobs are running very slow.

what will be the reason and how to makethem fasast
0
I need help creating a Script that will Check if the Uptime(Hours) is exided on Windows 10 Operating Systems. I am not that Scripting guy just a newbie in the Scripting world.The following will be the Parameters I would like to have:

Parameter 1 specifies after how many hours without rebooting the user is asked via a message box  to restart their computer themself or to shut down .

Parameter 2 specifies after how many hours without restarting will the script plan an automatic restart in 60min (with no prompt for cancelling)


The script must be controllable with at least two parameters
Thank You in Advance
0
how to automatically re-connect to rdp session,see pic
any powshell,vbs script?
thank you
error-message-rdp.bmp
0
Hi,

I have written a Java code long before to capture the Hourly counts from the SQL database and write it on the spreadsheet,

However the spreadsheet consists of 3 sheets,

Every one hour these 3 sheets should get appended with the values returned by the select statements. Also I need to maintain the Whole one month data in the spreadsheet. So, that I said to append the values at the end of each sheet.

Also, from 2nd and 3rd sheet , it is like a calculation, based on the result i need to send the mail to the people.

For example,
Start Time      End Time      Trans >10 sec      Total Trans      % of Impact
12.00 AM      01.00AM        17                                380                4.47%(Greater than 1) need to send mail to the user.

same action for sheet 3.

please share your ideas
0
Hi,

I have a file in production server every month I am downloading the file to my local and zipping.

Finally sending this file via FileLink to the person manually. Cant we make this task automate?

1. File will be avilable in one of the production server on /abc/test/test.psp
2. Our job should check the file in the location and download the file to local machine.
3. Once the file got downloaded, the file should be delivered to the user via Outlook or Filelink.

Please share your advise.

Thanks
Venkatesh.
0
Hi,

I have  a EXCEL Macro in my desktop we are daily double clicking that report and moving to First sheet(Sheet 1) and pressing CNTRL+D to download the files from the Share drive.  As a first step.

Also when it is getting update it will ask for save , dont save , Cancel message and we are clicking Save and it will get update automatically and get idle for sometime.

When we click the EXCEL CLOSE button, it will ask for save the sheet WILL click save. After that the sheet will get close automatically.

Need to automate this process. This is one of the pending daily reports which we have not automated.

Thanks for your help in advance.
0
I am trying to deploy Intune to all the computers in my company.  Unfortunately, MS requires the user to be a local admin to join Intune.  These are all AD Domain Joined.  I am looking for a way to give the logged in user local admin rights, have them connect to Intune with their username and password and then remove them from the local admin group.  So far I have this for my script:

Net localgroup administrators “domain\%username%” /add
Start ms-device-enrollment:?mode=mdm
Timeout 300
Net localgroup administrators “domain\%username%” /delete

It works fine if a domain admin right clicks and runs the batch file as administrator.  I would like it run as a logon script one time.  I also tried to copy the file to common startup folder so it would run at logon, but get access denied on the first line.  The rest of the script runs without error.  Has anyone had success joining computers to Intune without manually making users local admins?
0
I need help. How to create batch file to import value from text file and write it to registery during osd.
I want to add key  in hkl\software\syswow64\me\  the value would be jack,  help would be appreciated.
thanks
0
HI,

I have an ERP and its use windows local users authentication and i need a script to prompt users to change their password when password soon to expire as i configure on local security policy.
0
Free Tool: Path Explorer
LVL 11
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Dear,
In order to be used by a GPO, I would like to be assisted to create a script with take as input unc name with subfolders \\servername\Office Templates (on a server) and as output a pathnname on a workstation %public%\Office Templates

I'am currently learning powershell but my knowledge is not yet sufficient to be efficient.
any help is welcome.

tks
0
hi team

we require a script which will copy the reg file to remote servers and add it in registry.

we are implementing wsus. we don't want to use the GP. so we would like to add the reg key in our servers. please help to provide a nice script.
0
I have a folder A on 10 window machines located on  C drive folder temp which contains .cmd file for execution , I want to execute that .cmd file on all 10 windows machines from one machine using batch file. which should run in highest permission with run as administrator & UAC should not block when script executed.

Thanks in advance
0
Hi all...

I've tried finding what I need but most solutions offer various entries and switches on a vbs script or batch file.

I need to delete one single registry key if it is present. The key is as an example:

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Network Associates\ePolicy Orchestrator\Application Plugins\DATALOSS1000

How can I accomplish this, and run it remotely on approximately 300 systems?

Batch file preferred...

Thanks in advance...
0
i need a batch file to create this path: C:\Windows\winwin123
this path already exist: C:\Windows\  but the folder called  ''winwin123 '' must be created ,afetr is created i want to go there: C:\Windows\winwin123
0
How to automatically stop the exe process when it can not run? i start exe process i check ALL ACTIVE PROCESSES and I do not see him anywhere,then how can I stop it immediately
0

Windows Batch

11K

Solutions

11K

Contributors

Batch files are text files containing a script of commands that are executed by the command interpreter on DOS, OS/2 and Windows systems. Most commonly, they are used to perform a series of functions that are repeated -- copying a set of files created daily with one step, for example.