RE: Path pitfalls....

new topic     » topic index » view thread      » older message » newer message

> When it is run, the current directory is not that the same as where the 
> file is stored, because it's being run by an Access macro.
> How can I change the current directory?
> 
> I'm using win2k, but mapping network drives is not an option, because it 
> needs to be run by other people.
> 
> It won't work with absolute addressing either, because two of it's calls 
> are to PHP scripts, and they don't like being addressed that way; it 
> comes up with a CMD error. 
> The script used to work when only using relative addressing ( \bin,  ..\ 
> ,etc), and running via a double click... not possible any more.
> 
> Any help VERY appreciated.
> =======================
> Patrick Barnes
> Information Systems Group
> 201 Elizabeth St, Sydney
> Patrick.Barnes at tg.nsw.gov.au
> Ext: 91-3583
> Ph:(02) 9284-3583
> Mob: 0410 751 044

This might work for you.  At least I think it should.  I have not tested 
this personally.  In kernel32 dll is an API named SetCurrentDirectory.  
It takes a pointer to a path and changes the current directory for the 
current process.

Declaration:
BOOL SetCurrentDirectory(
LPCTSTR lpPathName // address of name of new current directory 
);

include Win32Lib.ew

==========
constant
SetCurrentDirectory = registerw32Procedure(
    kernel32, "SetCurrentDirectoryA", {C_POINTER} )

atom str
str = allocate_string("\\\\fp-ho1-pr\\HO_share\\Tier 3 Database\\bin\\")
w32Proc( SetCurrentDirectory, {str} )
free( str )
==========

Don

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu