Need VB script or Batch file to query Dirty bit

Hi Friends,
Could anybody help me in setting up a script which can query Dirty bit on all volumes of 50 servers ?
Thanks

Mike / JRV,
With your help, I could make a script which can find the local drives in a server. But i am blocked to proceed with dirty bit check on those local drives.
Iam trying my level to find it out :)
Thanks
Arun
You didn't look in the Repository did you?  You also didn't try the code posted above.  We cannot do this for you or would you like someone to remote into your system and do the typing?                     
fsutil dirty query C:
¯\_(ツ)_/¯

Similar Messages

  • Batch file to query an IP address and amend it

    Iain Smart wrote:So a client can have an IP address from any of 4 subnets?Do you have routing between the various subnets? Otherwise how do the clients connect to other internal resources (server, printers etc) that may be on another subnet?It sounds like you need to have some form of failover at the router rather than switching IP address at the client.This way you can leave the internal IP range and the router handles the multiple connections.However, you can use this command to change the IP address (needs admin priviledges):
    Batchfilenetsh interface ip set address name=”Local Area Connection” static

    Hi Guys,Right, I need to create a batch file which will query the LAN IP address then display what connection it is connected to.So, at one of our sites we have multiple internet connections due to it being in the middle of nowhere and the internet connections are very unstable.We have 2 ADSL connections and 2 4G/3G/2G connections which are all on the same LAN but are seperated by different subnetsSo I need the script to check the IP address and display whether it is on Connection A, B, C or DI will then need the script to ask the user which connection they would like to be on and then it will change the IP to fit the criteria of the subnet they wantThe DNS addresses stay the sameOh and this script will be ran on many different PCs so it needs to check the Local Area Connection and amend it current IP. for example:192.168.3.1 -...
    This topic first appeared in the Spiceworks Community

  • Powershell script calling batch file, how to "echo" or otherwise pass in two or more values asked for by batch file

    I've been having a lot of problems trying to get an old batch file we have laying around, to run from my powershell script. The batch file actually asks for two inputs from the user. I've managed to put together a powershell that echos a response, but of
    course, that only will answer one of the prompts. As usual, I've simplified things here to get my testing done. The batch file looks like this:
    @ECHO OFF
    SET /P CUSTID=Customer Number:
    SET /P DBCOUNT=Number of Live Databases:
    ECHO Customer Id was set to : %CUSTID%
    ECHO Database Count was set to : %DBCOUNT%
    Two inputs, two echos to verify values have been set. Now, the powershell looks like this:
    Param(
     [string]$ClientADG,
        [string]$ClientDBCount,
        [scriptblock]$Command
    $ClientADG = '1013'
    $ClientDBCount = '2'
    $Response = $ClientADG + "`r`n" + $ClientDBCount
    $Command = 'Invoke-Command -ComputerName localhost -ScriptBlock {cmd /c "echo ' + $ClientADG + ' | E:\Scripts\Setup\Company\DatabaseSetupTest.bat"}'
    powershell -command $Command
    Output looks like:
    Customer Number: Number of Live Databases: Customer Id was set to : 1013
    Database Count was set to :
    As expected, as I'm only passing in one value. I can't figure out how to get a second value passed in for the second prompt. Instead of $ClientADG, I tried to mash the two value together in the $Response variable with a cr/lf or a cr or a lf in between,
    but no go there either. The first input gets set to the second value, and second input is blank still. In the essence of time, I need to get this batch file called from Powershell to get some folks productive while I actually rewrite what the batch file does
    in another powershell, so it can be integrated into other things. (I'm automating what a bunch of people spend hours doing into multiple scripts and eventually one BIG script so they can focus on doing their real jobs instead).
    How do I get this right in powershell? I don't want to modify the batch file at all at this point, just get it running from the powershell.
    Thanks in advance!
    mpleaf

    It's a "simple" test so I can figure out how to get the arguments passed from ps to bat. The bat file looks like this:
    @ECHO OFF
    SET CUSTID = %1
    SET DBCOUNT = %2
    ECHO Customer Id was set to : %CUSTID%
    ECHO Database Count was set to : %DBCOUNT%
    That's it. The PS script looks like this:
    Invoke-Command-ComputerName myserver-ScriptBlock{cmd/c"E:\Scripts\Setup\Company\DatabaseSetupTest.bat
    1013 2"}
    That's it. The bat file exists on "myserver", and I'm getting the echo back, but without the values.
    mpleaf

  • I need to call a batch file from java and pass arguments to that Batch file

    Hi,
    I need to call a batch file from java and pass arguments to that Batch file.
    For example say: The batch file(test.bat) contains this command: mkdir
    I need to pass the name of the directory to the batch file as an argument from My Java program.
    Runtime.getRuntime().exec("cmd /c start test.bat");
    How to pass argument to the .bat file from Java now ?
    regards,
    Krish
    Edited by: Krish4Java on Oct 17, 2007 2:47 PM

    Hi Turing,
    I am able to pass the argument directly but unable to pass as a String.
    For example:
    Runtime.getRuntime().exec("cmd /c start test.bat sample ");
    When I pass it as a value sample, I am able to receive this value sample in the batch file. Do you know how to pass a String ?
    String s1="sample";
    Runtime.getRuntime().exec("cmd /c start test.bat s1 ");
    s1 gets passed here instead of value sample to the batch file.
    Pls let me know if you have a solution.
    Thanks,
    Krish

  • How to install and set printer paper and tray automatically via script or batch file

    Hi,
    Our firm using HP Printers and we need to deploy printer in Citrix Environment where setting does not save to the Base PC Image.
    Because our Environment is Citrix (User Settings and Printer are deployed when user login).
    Can we build the setting into the Base PC Image for All users?
    Printer get install when using login.
    Problem that I am encounter right now are:
    1. How to correctly identify all tray from each printer.
    2. How to set all paper tray to A4
    I am currently using Powershell Script to install printers during login, all the printer driver has been installed to the Base PC Image.
    But the trouble I have is when the script run to completion.
    It only added the printer.
    I've been googling, but I can't find a way to detect printer tray or how to set all the tray to A4.
    I don't mind using any type of script/batch file or even program.
    Any of the following language is C#, VB.NET, powershell, vbscript or Event Access to HP API ?
    Our Environment:
    Windows 7 x32 SP1
    Windows Server 2008 R2 (Print Server)
    I am using the PCL 6 Printer Driver.
    Our Printers are:
    HP LJ CP1025NW
    HP C LJ 4650
    HP C LJ 3525
    HP LJ 1045
    HP LJ 2050
    HP LJ 3055
    HP LJ 4015
    HP LJ 4350
    HP LJ 4700
    HP LJ 2035n
    Thanks in advance
    Regards Dat.

    Most of those printers are commercial grade printers.  It would be best to post in the commercial LaserJet forums.
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Unix shell script to batch file for windows

    Hello all,
    Iam writing a program in java in unix environment and iam executing using shell scripts in unix this program is for client-server environment
    which look like this:
    For server:
    #! /bin/ksh
    export CLASSPATH=/user/vpp/jal/classes:$CLASSPATH
    #set var for filename config file
    export JAL_CONF_FILE=/user/vpp/jal/conf/JALapp.conf
    java -DJAL_CONF_FILE=$JAL_CONF_FILE jalsvr/JALTCPServer 7776for client side it is
    #! /bin/ksh
    export CLASSPATH=/user/vpp/jal/classes:$CLASSPATH
    echo $CLASSPATH
    java jalcl/JALTCPClient msoc05:7776my question is know i want to execute them in windows by creating batch files runsvr.bat, runcl.batbut how
    i gave PATH by giving JRE path but what is the replacement of export because iam having all class files
    in /jalcl for clients and /jalsvr for server but want to create this batch file in separate /bin folder how to do.please help me

    Thank you for reply ,
    And sorry by mistake question repeated twice,
    but when iam executing those batch files it is throwing some exceptions,
    in that file you did not mention to set the JRE path whether it is not necessary and also there msoc05 is the machine name of unix system that need to kept or need to be changed with window IP address .please reply.
    thanks in advance.

  • How to combine offscrub vb script with batch file

    Hello all,
    I am trying to upgrade from Office 2010 to Office 2013, but Office 2013 does not completely remove all of Office 2010 and Visio 2010, so I want to use the offscrub vb script from this article (
    http://blogs.technet.com/b/odsupport/archive/2011/04/08/how-to-obtain-and-use-offscrub-to-automate-the-uninstallation-of-office-products.aspx) to first remove office 2010, Visio2010, and Project. I already extracted the offscrub vb script. How can I combine
    the offscrub vb script with a batch file I created to silently install office 2013, so that after offscrub is finished running, the office2013 install would begin? I would like to apply the file via GPO. Or if there is away that one file calls the other. 
    I would appreciate any help you can provide.
    Thank you

    Yes - that is not GP Software Distribution.  It is a very flakey method as you are finding out.  I highly recommend posting in the Office 2013 administration forum for assistance.  There are many 'gotchas".
    The problems will come as a result of needing to remove 2010.  If 2010 is a trial version or an expired license you will have many issues.  Also the build of the MSP needs to be manged correctly.
    I would add the uninstall script to the MSP package and make it a dependency or try and build an MSI to run the uninstall script using Software Distribution or run it independently and be sure you get a reboot before you attempt to do the install. 
    The Admins in Office 2013 forum will have many bits of experience that you will not likely find here or not find as readily.
    Good luck.
    ¯\_(ツ)_/¯

  • Run a script from batch file

    Hi All,
    I want to execute a SQL script that runs from a batch file.
    Lets say, I have loader.bat file. This .bat file connects to Oracle and wants
    to execute .sql file
    The content of loader.bat file is
    sqlplus
    @C:\temp_val_id.sqlAt run time it ask to userid and password. I enter the username and password and then get connect to Oracle
    But the temp_val_id.sql file is not exectuted.
    The output is as below, but .sql file is not executed
    C:\>sqlplus
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 28 17:19:50 2012
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Enter user-name: utest_tt_senayat/password@silver3
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>I am now trying a different method
    sqlplus
    @@C:\temp_val_id.sqlThe output is the same as above. Not executing temp_val_id.sql
    Could someone please assist me,
    Thanks in advance
    Saaz

    Saaz Ena wrote:
    sqlplus /nolog @test.sql
    content of test.sql:
    connect &user/&pass
    select sysdate from dual;
    exit;
    C:\work\test>sqlplus /nolog @test
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 28 16:21:12 2012
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Enter value for user: system
    Enter value for pass: manager
    Connected.
    SYSDATE
    28-MAR-12
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options

  • Need a script to move files to folders

    Hi guys.  I have found a lot of similar threads but not something exactly like what I need.
    I have a ton of files that need to be sorted into folders of the same name.  I found scripts to help me with that however, I have some variations on the files with an extension to the file name that also need to be moved into the same folders.
    For instance, I have a folder named....
    spiegal_case_25_video_3
    and I have the following files that all need to be moved into that folder....
    spiegal_case_25_video_3.mp4
    spiegal_case_25_video_3.webmsd.webm
    spiegal_case_25_video_3_h.flv
    spiegal_case_25_video_3_m.flv
    spiegal_case_25_video_3_l.flv
    I have found scripts to get me part of the way there but I can't get the FLVs into the folders because of the _h _m and _l extensions on the file names.  Is there a way to move these files into their appropriate folders (maybe by ignoring the last 2 characters in the file name?)
    I have also found a script that will read everything up to the underscore, but that won't help since the file names have multiple underscores.  So I really need a script that can do the sorting while ignoring the last 2 characters in the file name.
    Can anyone help me out?  I'm not very script savvy.
    Thanks!

    I've tested the following script (under OS X 10.8.5) with 4 subfolders and 20 files, all located in a folder called "Master folder" located in a USB flash drive named "EXT_DRIVE". It seems to work flawlessly. In its present state, the script will replace any file already located in any of the subfolders.
    set theMasterFolder to POSIX file "/Volumes/EXT_DRIVE/Master folder"
    tell application "Finder"
        activate
        set theFolders to (folders of folder theMasterFolder) as alias list
        repeat with thisFolder in theFolders
            set thisName to name of thisFolder
            move (files of folder theMasterFolder whose name begins with thisName) to thisFolder with replacing
        end repeat
    end tell

  • Need a script to batch automate "Crop & Straighten"

    So I have a few hundred image files that consist of 3 or 4 scanned photos also called "gang" scanned. The photoshop "Crop & Straighten" ability (located under File-->Automate) is great...But I want to be abe to run a script that will prompt me for a folder to be processed and then run the Crop & Straighten on all the photos, while saving them to another folder called "Edited" or something.  I found a script in the forums for this exact purpose, but it doesn't seem to work in CS5.  I ran it multiple times, it creates the folder "Edited" but nothing is inside of it. The script I found is posted below. Any ideas? I would really appreciate the help!
    #target Photoshop
    app.bringToFront;
    var inFolder = Folder.selectDialog("Please select folder to process");
    if(inFolder != null){
    var fileList = inFolder.getFiles(/\.(jpg|tif|psd|)$/i);
    var outfolder = new Folder(decodeURI(inFolder) + "/Edited");
    if (outfolder.exists == false) outfolder.create();
    for(var a = 0 ;a < fileList.length; a++){
    if(fileList[a] instanceof File){
    var doc= open(fileList[a]);
    doc.flatten();
    var docname = fileList[a].name.slice(0,-4);
    CropStraighten();
    doc.close(SaveOptions.DONOTSAVECHANGES);
    var count = 1;
    while(app.documents.length){
    var saveFile = new File(decodeURI(outfolder) + "/" + docname +"#"+ zeroPad(count,3) + ".jpg");
    SaveJPEG(saveFile, 12);
    activeDocument.close(SaveOptions.DONOTSAVECHANGES) ;
    count++;
    function CropStraighten() {
    executeAction( stringIDToTypeID('CropPhotosAuto0001'), undefined, DialogModes.NO );
    function SaveJPEG(saveFile, jpegQuality){
    jpgSaveOptions = new JPEGSaveOptions();
    jpgSaveOptions.embedColorProfile = true;
    jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
    jpgSaveOptions.matte = MatteType.NONE;
    jpgSaveOptions.quality = jpegQuality;
    activeDocument.saveAs(saveFile, jpgSaveOptions, true,Extension.LOWERCASE);
    function zeroPad(n, s) {
    n = n.toString();
    while (n.length < s) n = '0' + n;
    return n;

    Hi there,
    I have tested one script and encountered one problem; the script/PS is very aggressive. The result has been that single images have been divided to multiple images and many time "over cropped" and rotated in various degrees. Crazy : )
    Example Before/after:
    Dropbox - PS CROP&STRAIGHTEN
    Script used:
    Dropbox - CROPAndStraightenBatch.jsx
    I have about 3000 images that I would like to have cropped.
    What I would like to have is a script where I can state or set it to not allow it to divide pictures into many.
    Also...any script that can automate rotations as batch?
    Does this exist somewhere?
    Are there any scripts somewhere that I can test?
    Cheers
    Martin

  • Help Needed: InDesign Scripting: PDF Multiple Files and Pages Import

    I am looking for a script to merge two PDFs in InDesign CS3 (Mac or PC);
    with an interesting twist for print production.
    We have one PDF that is 408 pages. The second PDF is only one page.
    What we need to accomplish is importing the 408-page PDF file into InDesign,
    then inserting the second 1-page 408 times PDF AFTER every page of the first
    file.
    This will make a 816-page file, where every other page is the "generic" PDF.
    I've used PDFplacer.jsx and it does a great job of bringing in a PDF to
    InDesign. I'm hoping that there is another script to bring in the second
    1-page PDF and have it place this PDF after every page of the file.
    Does anyone know of a script that will accomplish this task?
    I'd also consider having this same scenario done in Acrobat, and then
    sending this new 816 page file to print, if there is any benefit to creating
    the file this way.
    Any help and suggestions would be greatly appreciated.
    Jim Lukens-Gable
    JHL4 at PSU.EDU

    Thanks, Robin,
    I am really a novice at scripting . . . would you be able to modify the script and then send it to me/post it here?
    Thank you!
    Jim L-G

  • Need a script to delete files

    Hi
    Can someone advise me on how to create a script to delete certain files from a users home account at logout?
    The files that I want deleting are .plist files in there ~/lib.../preferences folder, this is so I can ensure that all users will have the same settings for certain files next time they login again.
    Thanks

    That being said, if you you still really want to do this you can create a logout hook and write a shell script to remove the files.  See "About Daemons and Services", Appendix B on writing a logout hook.
    But a far easier way is to create Account's login item that will cause a shell script to be launched to delete the files.  You can encapsulate the shell script so it runs as an application that can be added to the Login Items.  One such encapsulator is Platypus.
    Note, rather than delete them, if you want to ensure all the specific plists have specific settings, then create a master set of them and copy the master set into the Preferences directory (being careful to observe ownership and permissions settings of course).

  • How to run sql scripts using batch file for a web dynpro data dictionary

    Hi,
    I want to develop a sql script to be executed on the server alongwith the installation of a product to pre-populate web dynpro data dictionary tables required for the application.
    I further require to make the scripts independent of the database name,so that it can be run at any client environment.
    Your help will be appreciated and rewarded.

    See shoblock's answer
    call sql script from unix
    masterfile.sql:
    @file1 &1
    @file2 &2
    @file3 &3
    @file4 &4
    then just call the master script:
    sqlplus userid/password @masterfile <p1> <p2> <p3> <p4>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Help needed in executing a remote batch file

    I need to execute a batch file which is located on a remote machine through my machine. I have no idea to go about with. Please can someone help me out with can be used to execute the remote bat file. I am at present using Runtime.exec() to execute it on my machine.. But i cant use it to execute teh bat file on teh remote machine.Please help

    Below is an example server that would run on the remote host. You can connect to it using telnet from DOS prompt, it takes a Y/N to run your command in the cmd variable. I haven't included code for a client as it's really not needed for the example below.
    Change the cmd and port variables to what you need. You may need to setup firewall rules to allow your chosen port.
    Once it's running, you can test it by using "telnet localhost 1234" on your machine, localhost would obviously become the remote computer's hostname or IP.
    I am incredibly new to Java (using the forums to learn bits), so excuse any bad coding practises, I'm sure people will point them out.
    Keep in mind that this is totally insecure, so if you're using it on an untrusted network, you may want to look into encryption and providing some kind of password authentication, that, for the moment is out of my league.
    Screenshot here.
    import java.io.*;
    import java.net.*;
    class RemoteServer {
         public static int    port = 1234;           // Port to listen on
         public static String cmd  = "C:\\Test.bat"; // Command to run
         public static void main(String[] args)
              System.out.println("Waiting for connection...");
              try {
                   /* If you want the server to run forever, uncomment the while
                      loop */
                   // while (true)
                        startServer();
              } catch (IOException e) {
                   e.printStackTrace();
                   System.exit(1);
         /* Starts the server */
         private static void startServer() throws IOException
              ServerSocket server = null;
              Socket       client = null;
              String input;
              try {
                   server = new ServerSocket(port);
              } catch (IOException e) {
                   System.err.println("Unable to list on port " + port);
                   System.exit(1); // Can't listen, nothing else to do
              try {
                   client = server.accept();
                   System.out.println("Client connected... awaiting Y/N");
              } catch (IOException e) {
                   System.err.println("Unable to accept connection.");
                   System.exit(1);
              PrintWriter out = new PrintWriter(client.getOutputStream(), true);
              BufferedReader in = new BufferedReader(new InputStreamReader(
                                                     client.getInputStream()));
              out.println("You are connected, ready to launch command: <y/n>");
              while ((input = in.readLine()) != null)
                   if (input.equalsIgnoreCase("y"))
                        Runtime rt = Runtime.getRuntime();
                        rt.exec(cmd);
                        out.println("Command executed... disconnecting.");
                        System.out.println("Command executed... disconnecting client.");
                        break;
                   } else if (input.equalsIgnoreCase("n")) {
                        break;
                   } else {
                        out.println("Please enter Y/N.");
              out.close();
              in.close();
              client.close();
              server.close();
    }

  • Need script for moving files to specific directories base on csv

    Hi,
    I have a question. I have about 2000 files (pdf), which I need move to specific directories and subdirectories, which are based on csv file.
    Csv is looking like this:
    filename;directoryname;subdirectoryname;subdirectoryname;.......etc.
    I have a script for creating directories with subdirectories from csv file, but I need this script for moving files to this directories.....
    Thanks a lot for every help.
    Best Regards
    Petr, OS X Mavericks

    private function snapshotLastFrame():void
    gotoAndStop( this.totalFrames );
    _bitmapData                         = new BitmapData( stage.stageWidth, stage.stageHeight );
    _bitmap                              = new Bitmap( _bitmapData );
    _bitmapData.draw ( stage );
    saveImageJPG( _bitmapData, "test.jpg", 96 );
    public function saveImageJPG( bitmapData:BitmapData, fileName:String, quality:int ):void {
                this.jpgEncoder = new JPGEncoder( quality );
                this.fileReference = new FileReference();
                this.fileReference.save( this.jpgEncoder.encode( bitmapData ), fileName + ".jpg" );
    Keep in mind that you need a few extra libraries to be able to create a jpeg.. (AS3CoreLib) can be found at googleCode.

Maybe you are looking for