Results 1 to 5 of 5

Thread: [RESOLVED] Can I run a .BAT file on a PPC

  1. #1

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Resolved [RESOLVED] Can I run a .BAT file on a PPC

    I've got a .BAT file I'm creating to rename a couple of files on my PPC - but doesn't seem you can run a .BAT file on a ppc - is that true??

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Can I run a .BAT file on a PPC

    Natively, no you can't - but there are some alternatives.
    http://www.symbolictools.de/public/p.../cmd/index.htm is one, and there used to be a wonderful scripting tool called 'nscriptm', but it seems to had vanished.

    Stop Press - found it at http://s-k-tools.com/index.html?m_util.html
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  3. #3

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Can I run a .BAT file on a PPC

    Well - that stinks - I'll just write a tiny .Net app to do it - will give me more flexibility anyway - in case the rename fails and what not...

    Here's what I'm trying to accomplish if you are interested

    http://www.vbforums.com/showthread.php?t=488573

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Can I run a .BAT file on a PPC

    Wow - it is amazing how much time you lose working with the CF...

    I am writing a silly little console app - and I cannot for the life of me find out the "current directory" that this console app is running in!

    Reflection.Assembly.GetExecutingAssembly is not around

    IO.Directory.GetCurrentDirectory is not supported yet

    How do I find out the location of the .exe that is running on a PPC??

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  5. #5

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Can I run a .BAT file on a PPC

    Ok - I dropped the idea for a .BAT file and I'm instead using a little update program written in .net

    Code:
    Imports System.IO
    
    Module APCUpd
    
        Sub Main(ByVal args As String())
    
            Dim s1 As String = args(0).Replace("~", " ")
    
            MsgBox(s1)
    
            File.Move(Path.Combine(s1, "APC1.txt"), Path.Combine(s1, "APC2.txt"))
    
        End Sub
    
    End Module
    This is actually stored in a database on a network server and "dropped" onto a pocket PC with this code

    Code:
    Dim ExeData As Byte() = DirectCast(LDrc.ExecuteScalar, Byte())
    
    Dim fs As New FileStream(Path.Combine(strBaseFolder, "APCUpd.exe"), FileMode.CreateNew)
    Using bw As BinaryWriter = New BinaryWriter(fs)
        bw.Write(ExeData)
        bw.Close()
    End Using
    And then it's run with this:

    Code:
    Process.Start(Path.Combine(strBaseFolder, "APCUpd.exe"), strBaseFolder.Replace(" ", "~"))
    The reason for the tilde replace is that spaces were causing multiple "arguments" to be passed into the SUB MAIN()

    I'm going to use all this for "self-upgrading" programs on PPC when the network database has a new version available.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width